Skip to content

Commit

Permalink
Additional fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
iranl committed Feb 6, 2024
1 parent 9463ee9 commit ac58d23
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions Network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ void Network::publishHASSConfig(char* deviceType, const char* baseTopic, char* n
"Unlatch",
name,
baseTopic,
_lockPath + mqtt_topic_mqtt_connection_state,
"",
deviceType,
"",
"",
Expand All @@ -974,7 +974,7 @@ void Network::publishHASSConfigAdditionalButtons(char *deviceType, const char *b
"Lock 'n' Go",
name,
baseTopic,
_lockPath + mqtt_topic_mqtt_connection_state,
"",
deviceType,
"",
"",
Expand All @@ -991,7 +991,7 @@ void Network::publishHASSConfigAdditionalButtons(char *deviceType, const char *b
"Lock 'n' Go with unlatch",
name,
baseTopic,
_lockPath + mqtt_topic_mqtt_connection_state,
"",
deviceType,
"",
"",
Expand Down Expand Up @@ -1245,8 +1245,12 @@ void Network::publishHassTopic(const String& mqttDeviceType,
{
json["dev_cla"] = deviceClass;
}
json["stat_t"] = stateTopic;


if(stateTopic != "")
{
json["stat_t"] = stateTopic;
}

if(stateClass != "")
{
json["stat_cla"] = stateClass;
Expand All @@ -1259,6 +1263,8 @@ void Network::publishHassTopic(const String& mqttDeviceType,
{
json["cmd_t"] = commandTopic;
}

json["avty"]["t"] = _lockPath + mqtt_topic_mqtt_connection_state;

for(const auto& entry : additionalEntries)
{
Expand Down

0 comments on commit ac58d23

Please sign in to comment.