From dab9baf9cad95165b246063b0622ce7def7fc381 Mon Sep 17 00:00:00 2001 From: technyon Date: Mon, 25 Nov 2024 04:03:44 +0100 Subject: [PATCH] fix order of init topics initalization and publishing --- src/Config.h | 2 +- src/NukiNetwork.cpp | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Config.h b/src/Config.h index c18099a..c095044 100644 --- a/src/Config.h +++ b/src/Config.h @@ -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" diff --git a/src/NukiNetwork.cpp b/src/NukiNetwork.cpp index 829583a..9c4e493 100644 --- a/src/NukiNetwork.cpp +++ b/src/NukiNetwork.cpp @@ -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)