Merge pull request #544 from iranl/fix-reset-mqtt-topics

Fix reset mqtt topics
This commit is contained in:
iranl
2024-11-28 22:28:02 +01:00
committed by GitHub
2 changed files with 6 additions and 3 deletions

View File

@@ -608,7 +608,7 @@ void HomeAssistantDiscovery::publishHASSDeviceConfig(char* deviceType, const cha
"",
{ { (char*)"en", (char*)"true" } });
if(_offEnabled)
if(_offEnabled && strcmp(deviceType, "SmartLock") == 0)
{
// Hybrid connected
String hybridPath = _baseTopic;

View File

@@ -723,8 +723,11 @@ bool NukiNetwork::reconnect()
removeTopic(_maintenancePathPrefix, topic);
removeTopic(mqttLockPath, topic);
removeTopic(mqttOpenerPath, topic);
removeTopic(mqttOldOpenerPath, topic);
removeTopic(mqttOldOpenerPath2, topic);
if (len > 5)
{
removeTopic(mqttOldOpenerPath, topic);
removeTopic(mqttOldOpenerPath2, topic);
}
}
_preferences->putBool(preference_reset_mqtt_topics, false);