diff --git a/src/NukiNetwork.cpp b/src/NukiNetwork.cpp index dbbb7c3..4fc2ae1 100644 --- a/src/NukiNetwork.cpp +++ b/src/NukiNetwork.cpp @@ -757,6 +757,9 @@ bool NukiNetwork::reconnect() initTopic(_maintenancePathPrefix, mqtt_topic_reset, "0"); subscribe(_maintenancePathPrefix, mqtt_topic_reset); + initTopic(_maintenancePathPrefix, mqtt_topic_freeheap, ""); + initTopic(_maintenancePathPrefix, mqtt_topic_log, ""); + initTopic(_maintenancePathPrefix, mqtt_topic_wifi_rssi, ""); if(_preferences->getBool(preference_update_from_mqtt, false)) { diff --git a/src/NukiNetworkLock.cpp b/src/NukiNetworkLock.cpp index 5347f40..6229d6a 100644 --- a/src/NukiNetworkLock.cpp +++ b/src/NukiNetworkLock.cpp @@ -51,6 +51,7 @@ void NukiNetworkLock::initialize() _network->initTopic(_mqttPath, mqtt_topic_config_action, "--"); _network->subscribe(_mqttPath, mqtt_topic_config_action); + _network->initTopic(_mqttPath, mqtt_topic_query_keypad, "0"); _network->initTopic(_mqttPath, mqtt_topic_query_config, "0"); _network->initTopic(_mqttPath, mqtt_topic_query_lockstate, "0"); _network->initTopic(_mqttPath, mqtt_topic_query_battery, "0"); @@ -58,6 +59,21 @@ void NukiNetworkLock::initialize() _network->subscribe(_mqttPath, mqtt_topic_query_lockstate); _network->subscribe(_mqttPath, mqtt_topic_query_battery); + _network->initTopic(_mqttPath, mqtt_topic_auth_action, "--"); + _network->initTopic(_mqttPath, mqtt_topic_timecontrol_action, "--"); + _network->initTopic(_mqttPath, mqtt_topic_keypad_json_action, "--"); + _network->initTopic(_mqttPath, mqtt_topic_lock_retry, "0"); + + _network->removeTopic(_mqttPath, mqtt_topic_hybrid_state); + _network->removeTopic(_mqttPath, mqtt_topic_config_action_command_result); + _network->removeTopic(_mqttPath, mqtt_topic_keypad_command_result); + _network->removeTopic(_mqttPath, mqtt_topic_keypad_json_command_result); + _network->removeTopic(_mqttPath, mqtt_topic_timecontrol_command_result); + _network->removeTopic(_mqttPath, mqtt_topic_auth_command_result); + _network->removeTopic(_mqttPath, mqtt_topic_query_lockstate_command_result); + _network->removeTopic(_mqttPath, mqtt_topic_lock_completionStatus); + _network->removeTopic(_mqttPath, mqtt_topic_lock_action_command_result); + if(_disableNonJSON) { _network->removeTopic(_mqttPath, mqtt_topic_keypad_command_action); @@ -110,21 +126,17 @@ void NukiNetworkLock::initialize() _network->subscribe(_mqttPath, mqtt_topic_keypad_command_enabled); } - _network->initTopic(_mqttPath, mqtt_topic_query_keypad, "0"); - _network->initTopic(_mqttPath, mqtt_topic_keypad_json_action, "--"); _network->subscribe(_mqttPath, mqtt_topic_query_keypad); _network->subscribe(_mqttPath, mqtt_topic_keypad_json_action); } if(_preferences->getBool(preference_timecontrol_control_enabled)) { - _network->initTopic(_mqttPath, mqtt_topic_timecontrol_action, "--"); _network->subscribe(_mqttPath, mqtt_topic_timecontrol_action); } if(_preferences->getBool(preference_auth_control_enabled)) { - _network->initTopic(_mqttPath, mqtt_topic_auth_action, "--"); _network->subscribe(_mqttPath, mqtt_topic_auth_action); } diff --git a/src/NukiNetworkOpener.cpp b/src/NukiNetworkOpener.cpp index b13a39d..01cbff3 100644 --- a/src/NukiNetworkOpener.cpp +++ b/src/NukiNetworkOpener.cpp @@ -39,6 +39,7 @@ void NukiNetworkOpener::initialize() _network->initTopic(_mqttPath, mqtt_topic_config_action, "--"); _network->subscribe(_mqttPath, mqtt_topic_config_action); + _network->initTopic(_mqttPath, mqtt_topic_query_keypad, "0"); _network->initTopic(_mqttPath, mqtt_topic_query_config, "0"); _network->initTopic(_mqttPath, mqtt_topic_query_lockstate, "0"); _network->initTopic(_mqttPath, mqtt_topic_query_battery, "0"); @@ -47,6 +48,20 @@ void NukiNetworkOpener::initialize() _network->subscribe(_mqttPath, mqtt_topic_query_config); _network->subscribe(_mqttPath, mqtt_topic_query_lockstate); _network->subscribe(_mqttPath, mqtt_topic_query_battery); + + _network->initTopic(_mqttPath, mqtt_topic_keypad_json_action, "--"); + _network->initTopic(_mqttPath, mqtt_topic_timecontrol_action, "--"); + _network->initTopic(_mqttPath, mqtt_topic_auth_action, "--"); + _network->initTopic(_mqttPath, mqtt_topic_lock_retry, "0"); + + _network->removeTopic(_mqttPath, mqtt_topic_config_action_command_result); + _network->removeTopic(_mqttPath, mqtt_topic_keypad_command_result); + _network->removeTopic(_mqttPath, mqtt_topic_keypad_json_command_result); + _network->removeTopic(_mqttPath, mqtt_topic_timecontrol_command_result); + _network->removeTopic(_mqttPath, mqtt_topic_auth_command_result); + _network->removeTopic(_mqttPath, mqtt_topic_query_lockstate_command_result); + _network->removeTopic(_mqttPath, mqtt_topic_lock_completionStatus); + _network->removeTopic(_mqttPath, mqtt_topic_lock_action_command_result); if(_disableNonJSON) { @@ -94,21 +109,17 @@ void NukiNetworkOpener::initialize() _network->subscribe(_mqttPath, mqtt_topic_keypad_command_enabled); } - _network->initTopic(_mqttPath, mqtt_topic_query_keypad, "0"); - _network->initTopic(_mqttPath, mqtt_topic_keypad_json_action, "--"); _network->subscribe(_mqttPath, mqtt_topic_query_keypad); _network->subscribe(_mqttPath, mqtt_topic_keypad_json_action); } if(_preferences->getBool(preference_timecontrol_control_enabled, false)) { - _network->initTopic(_mqttPath, mqtt_topic_timecontrol_action, "--"); _network->subscribe(_mqttPath, mqtt_topic_timecontrol_action); } if(_preferences->getBool(preference_auth_control_enabled)) { - _network->initTopic(_mqttPath, mqtt_topic_auth_action, "--"); _network->subscribe(_mqttPath, mqtt_topic_auth_action); }