Additional fixes
This commit is contained in:
16
Network.cpp
16
Network.cpp
@@ -951,7 +951,7 @@ void Network::publishHASSConfig(char* deviceType, const char* baseTopic, char* n
|
|||||||
"Unlatch",
|
"Unlatch",
|
||||||
name,
|
name,
|
||||||
baseTopic,
|
baseTopic,
|
||||||
_lockPath + mqtt_topic_mqtt_connection_state,
|
"",
|
||||||
deviceType,
|
deviceType,
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
@@ -974,7 +974,7 @@ void Network::publishHASSConfigAdditionalButtons(char *deviceType, const char *b
|
|||||||
"Lock 'n' Go",
|
"Lock 'n' Go",
|
||||||
name,
|
name,
|
||||||
baseTopic,
|
baseTopic,
|
||||||
_lockPath + mqtt_topic_mqtt_connection_state,
|
"",
|
||||||
deviceType,
|
deviceType,
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
@@ -991,7 +991,7 @@ void Network::publishHASSConfigAdditionalButtons(char *deviceType, const char *b
|
|||||||
"Lock 'n' Go with unlatch",
|
"Lock 'n' Go with unlatch",
|
||||||
name,
|
name,
|
||||||
baseTopic,
|
baseTopic,
|
||||||
_lockPath + mqtt_topic_mqtt_connection_state,
|
"",
|
||||||
deviceType,
|
deviceType,
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
@@ -1245,8 +1245,12 @@ void Network::publishHassTopic(const String& mqttDeviceType,
|
|||||||
{
|
{
|
||||||
json["dev_cla"] = deviceClass;
|
json["dev_cla"] = deviceClass;
|
||||||
}
|
}
|
||||||
json["stat_t"] = stateTopic;
|
|
||||||
|
if(stateTopic != "")
|
||||||
|
{
|
||||||
|
json["stat_t"] = stateTopic;
|
||||||
|
}
|
||||||
|
|
||||||
if(stateClass != "")
|
if(stateClass != "")
|
||||||
{
|
{
|
||||||
json["stat_cla"] = stateClass;
|
json["stat_cla"] = stateClass;
|
||||||
@@ -1259,6 +1263,8 @@ void Network::publishHassTopic(const String& mqttDeviceType,
|
|||||||
{
|
{
|
||||||
json["cmd_t"] = commandTopic;
|
json["cmd_t"] = commandTopic;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
json["avty"]["t"] = _lockPath + mqtt_topic_mqtt_connection_state;
|
||||||
|
|
||||||
for(const auto& entry : additionalEntries)
|
for(const auto& entry : additionalEntries)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user