From 47c4ca6551b4e402c0030515b6920daf05bb107e Mon Sep 17 00:00:00 2001 From: lumapu Date: Fri, 4 Aug 2023 18:26:42 +0200 Subject: [PATCH] 0.7.22 * attempt to fix homeassistant auto discovery #1066 --- src/CHANGES.md | 3 +++ src/defines.h | 2 +- src/publisher/pubMqtt.h | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/CHANGES.md b/src/CHANGES.md index 731cd4796..e997d1cb1 100644 --- a/src/CHANGES.md +++ b/src/CHANGES.md @@ -1,5 +1,8 @@ # Development Changes +## 0.7.22 - 2023-08-04 +* attempt to fix homeassistant auto discovery #1066 + ## 0.7.21 - 2023-07-30 * fix MqTT YieldDay Total goes to 0 serveral times #1016 diff --git a/src/defines.h b/src/defines.h index 579a2d8f8..57b367bb0 100644 --- a/src/defines.h +++ b/src/defines.h @@ -13,7 +13,7 @@ //------------------------------------- #define VERSION_MAJOR 0 #define VERSION_MINOR 7 -#define VERSION_PATCH 21 +#define VERSION_PATCH 22 //------------------------------------- typedef struct { diff --git a/src/publisher/pubMqtt.h b/src/publisher/pubMqtt.h index fa12e9690..771b1ee80 100644 --- a/src/publisher/pubMqtt.h +++ b/src/publisher/pubMqtt.h @@ -391,9 +391,9 @@ class PubMqtt { const char *devCls, *stateCls; if (!total) { if (rec->assign[mDiscovery.sub].ch == CH0) - snprintf(name, 32, "%s %s", iv->config->name, iv->getFieldName(mDiscovery.sub, rec)); + snprintf(name, 32, "%s %s", iv->getFieldName(mDiscovery.sub, rec)); else - snprintf(name, 32, "%s CH%d %s", iv->config->name, rec->assign[mDiscovery.sub].ch, iv->getFieldName(mDiscovery.sub, rec)); + snprintf(name, 32, "CH%d_%s", rec->assign[mDiscovery.sub].ch, iv->getFieldName(mDiscovery.sub, rec)); snprintf(topic, 64, "/ch%d/%s", rec->assign[mDiscovery.sub].ch, iv->getFieldName(mDiscovery.sub, rec)); snprintf(uniq_id, 32, "ch%d_%s", rec->assign[mDiscovery.sub].ch, iv->getFieldName(mDiscovery.sub, rec));