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

@@ -4,7 +4,7 @@
#define NUKI_HUB_VERSION "9.03"
#define NUKI_HUB_BUILD "unknownbuildnr"
#define NUKI_HUB_DATE "2024-11-24"
#define NUKI_HUB_DATE "2024-11-25"
#define GITHUB_LATEST_RELEASE_URL (char*)"https://github.com/technyon/nuki_hub/releases/latest"
#define GITHUB_OTA_MANIFEST_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/manifest.json"

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)