From 9d7cd00d2dcdf4d58d4f0628c1be687a3781be17 Mon Sep 17 00:00:00 2001 From: iranl Date: Sat, 4 Jan 2025 21:24:12 +0100 Subject: [PATCH] -Implement BLE retry after failed hybrid lockaction --- src/NukiWrapper.cpp | 7 +++++-- src/WebCfgServer.cpp | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/NukiWrapper.cpp b/src/NukiWrapper.cpp index 3ab67ce..8d82ac4 100644 --- a/src/NukiWrapper.cpp +++ b/src/NukiWrapper.cpp @@ -1091,8 +1091,11 @@ LockActionResult NukiWrapper::onLockActionReceived(const char *value) { if(_preferences->getBool(preference_official_hybrid_actions, false)) { - _nukiOfficial->setOffCommandExecutedTs(espMillis() + 2000); - _offCommand = action; + if(_preferences->getBool(preference_official_hybrid_retry, false)) + { + _nukiOfficial->setOffCommandExecutedTs(espMillis() + 2000); + _offCommand = action; + } _network->publishOffAction((int)action); } else diff --git a/src/WebCfgServer.cpp b/src/WebCfgServer.cpp index 1746de4..370ee28 100644 --- a/src/WebCfgServer.cpp +++ b/src/WebCfgServer.cpp @@ -4042,7 +4042,7 @@ esp_err_t WebCfgServer::buildMqttConfigHtml(PsychicRequest *request, PsychicResp printCheckBox(&response, "OFFHYBRID", "Enable hybrid official MQTT and Nuki Hub setup", _preferences->getBool(preference_official_hybrid_enabled), ""); printCheckBox(&response, "HYBRIDACT", "Enable sending actions through official MQTT", _preferences->getBool(preference_official_hybrid_actions), ""); printInputField(&response, "HYBRIDTIMER", "Time between status updates when official MQTT is offline (seconds)", _preferences->getInt(preference_query_interval_hybrid_lockstate), 5, ""); - // printCheckBox(&response, "HYBRIDRETRY", "Retry command sent using official MQTT over BLE if failed", _preferences->getBool(preference_official_hybrid_retry), ""); // NOT IMPLEMENTED (YET?) + printCheckBox(&response, "HYBRIDRETRY", "Retry command sent using official MQTT over BLE if failed", _preferences->getBool(preference_official_hybrid_retry), ""); response.print(""); response.print("* If no encryption is configured for the MQTT broker, leave empty.

"); response.print("
");