Merge pull request #544 from iranl/fix-reset-mqtt-topics
Fix reset mqtt topics
This commit is contained in:
@@ -608,7 +608,7 @@ void HomeAssistantDiscovery::publishHASSDeviceConfig(char* deviceType, const cha
|
|||||||
"",
|
"",
|
||||||
{ { (char*)"en", (char*)"true" } });
|
{ { (char*)"en", (char*)"true" } });
|
||||||
|
|
||||||
if(_offEnabled)
|
if(_offEnabled && strcmp(deviceType, "SmartLock") == 0)
|
||||||
{
|
{
|
||||||
// Hybrid connected
|
// Hybrid connected
|
||||||
String hybridPath = _baseTopic;
|
String hybridPath = _baseTopic;
|
||||||
|
|||||||
@@ -723,9 +723,12 @@ bool NukiNetwork::reconnect()
|
|||||||
removeTopic(_maintenancePathPrefix, topic);
|
removeTopic(_maintenancePathPrefix, topic);
|
||||||
removeTopic(mqttLockPath, topic);
|
removeTopic(mqttLockPath, topic);
|
||||||
removeTopic(mqttOpenerPath, topic);
|
removeTopic(mqttOpenerPath, topic);
|
||||||
|
if (len > 5)
|
||||||
|
{
|
||||||
removeTopic(mqttOldOpenerPath, topic);
|
removeTopic(mqttOldOpenerPath, topic);
|
||||||
removeTopic(mqttOldOpenerPath2, topic);
|
removeTopic(mqttOldOpenerPath2, topic);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_preferences->putBool(preference_reset_mqtt_topics, false);
|
_preferences->putBool(preference_reset_mqtt_topics, false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user