fix order of init topics initalization and publishing

This commit is contained in:
technyon
2024-11-25 04:03:44 +01:00
parent a2bcb1e58e
commit dab9baf9ca
2 changed files with 6 additions and 5 deletions

View File

@@ -731,10 +731,6 @@ bool NukiNetwork::reconnect()
}
publishString(_maintenancePathPrefix, mqtt_topic_network_device, _device->deviceName().c_str(), true);
for(const auto& it : _initTopics)
{
publish(it.first.c_str(), it.second.c_str(), true);
}
if(_preferences->getBool(preference_mqtt_hass_enabled, false))
{
@@ -753,6 +749,11 @@ bool NukiNetwork::reconnect()
initTopic(_maintenancePathPrefix, mqtt_topic_webserver_action, "--");
subscribe(_maintenancePathPrefix, mqtt_topic_webserver_action);
initTopic(_maintenancePathPrefix, mqtt_topic_webserver_state, (_preferences->getBool(preference_webserver_enabled, true) || forceEnableWebServer ? "1" : "0"));
for(const auto& it : _initTopics)
{
publish(it.first.c_str(), it.second.c_str(), true);
}
}
for(const String& topic : _subscribedTopics)