fix ha auto discovery
This commit is contained in:
2
Config.h
2
Config.h
@@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define NUKI_HUB_VERSION "8.9-json-2"
|
#define NUKI_HUB_VERSION "8.9-json-3"
|
||||||
|
|
||||||
#define MQTT_QOS_LEVEL 1
|
#define MQTT_QOS_LEVEL 1
|
||||||
#define MQTT_CLEAN_SESSIONS false
|
#define MQTT_CLEAN_SESSIONS false
|
||||||
@@ -630,7 +630,7 @@ void Network::publishHASSConfig(char* deviceType, const char* baseTopic, char* n
|
|||||||
baseTopic,
|
baseTopic,
|
||||||
mqtt_topic_battery_voltage,
|
mqtt_topic_battery_voltage,
|
||||||
deviceType,
|
deviceType,
|
||||||
"battery",
|
"voltage",
|
||||||
"measurement",
|
"measurement",
|
||||||
"diagnostic",
|
"diagnostic",
|
||||||
"V");
|
"V");
|
||||||
@@ -790,7 +790,10 @@ void Network::publishHassTopic(const String& mqttDeviceType,
|
|||||||
json["~"] = baseTopic;
|
json["~"] = baseTopic;
|
||||||
json["name"] = name + String(" " + displayName);
|
json["name"] = name + String(" " + displayName);
|
||||||
json["unique_id"] = String(uidString) + uidStringPostfix;
|
json["unique_id"] = String(uidString) + uidStringPostfix;
|
||||||
json["dev_cla"] = deviceClass;
|
if(deviceClass != "")
|
||||||
|
{
|
||||||
|
json["dev_cla"] = deviceClass;
|
||||||
|
}
|
||||||
json["stat_t"] = String("~") + stateTopic;
|
json["stat_t"] = String("~") + stateTopic;
|
||||||
|
|
||||||
if(stateClass != "")
|
if(stateClass != "")
|
||||||
|
|||||||
Reference in New Issue
Block a user