From 11203da6326ed9a8c89af1139b28a6861a9e3763 Mon Sep 17 00:00:00 2001 From: iranl Date: Fri, 4 Apr 2025 15:47:46 +0200 Subject: [PATCH] New commands --- lib/nuki_ble | 2 +- src/Config.h | 2 +- src/NukiWrapper.cpp | 37 ++++++++++++++++++++++++++++++++++++- src/NukiWrapper.h | 1 + 4 files changed, 39 insertions(+), 3 deletions(-) diff --git a/lib/nuki_ble b/lib/nuki_ble index cf762e7..bd91181 160000 --- a/lib/nuki_ble +++ b/lib/nuki_ble @@ -1 +1 @@ -Subproject commit cf762e7dbd6ed501e9b719a7a4b9590ec85c7f99 +Subproject commit bd91181b3e3a182fb6e822077b6f0f3f711934cc diff --git a/src/Config.h b/src/Config.h index 5649086..1c669b2 100644 --- a/src/Config.h +++ b/src/Config.h @@ -5,7 +5,7 @@ #define NUKI_HUB_VERSION "9.10" #define NUKI_HUB_VERSION_INT (uint32_t)910 #define NUKI_HUB_BUILD "unknownbuildnr" -#define NUKI_HUB_DATE "2025-04-02" +#define NUKI_HUB_DATE "2025-04-04" #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/NukiWrapper.cpp b/src/NukiWrapper.cpp index 3be7a82..48fc976 100644 --- a/src/NukiWrapper.cpp +++ b/src/NukiWrapper.cpp @@ -359,7 +359,8 @@ void NukiWrapper::update(bool reboot) { Log->println("Updating Lock config based on timer or query"); _nextConfigUpdateTs = ts + _intervalConfig * 1000; - updateConfig(); + updateConfig(); + updateDebug(); } if(_waitAuthLogUpdateTs != 0 && ts > _waitAuthLogUpdateTs) { @@ -728,6 +729,40 @@ void NukiWrapper::updateConfig() } } +void NukiWrapper::updateDebug() +{ + Nuki::CmdResult result = (Nuki::CmdResult)-1; + Log->println("Running debug command - RequestGeneralStatistics"); + result = _nukiLock.genericCommand(Nuki::Command::RequestGeneralStatistics); + Log->print("Result: "); + Log->println(result); + Log->println("Debug command complete"); + Log->println("Running debug command - RequestMqttConfig"); + result = (Nuki::CmdResult)-1; + result = _nukiLock.genericCommand(Nuki::Command::RequestMqttConfig); + Log->print("Result: "); + Log->println(result); + Log->println("Debug command complete"); + + /* + RequestGeneralStatistics = 0x0063, + RequestMqttConfig = 0x008B, + + RequestInternalLogEntries = 0x0065, + RequestAccessoryInfo = 0x0091, + RequestMatterPairings = 0x0112 + CheckKeypadCode = 0x006E, + + SmartLockScanWifi = 0x0080, + SmartLockConnectWifi = 0x0082, + SmartLockSetWifiConfig = 0x0087, + SetMqttConfig = 0x008D, + SetKeypad2Config = 0x009C, + EnableMatterCommissioning = 0x0110, + SetMatterState = 0x0111, + */ +} + void NukiWrapper::updateAuthData(bool retrieved) { if(!isPinValid()) diff --git a/src/NukiWrapper.h b/src/NukiWrapper.h index 1fe4d1f..db1cc49 100644 --- a/src/NukiWrapper.h +++ b/src/NukiWrapper.h @@ -69,6 +69,7 @@ private: bool updateKeyTurnerState(); void updateBatteryState(); void updateConfig(); + void updateDebug(); void updateAuthData(bool retrieved); void updateKeypad(bool retrieved); void updateTimeControl(bool retrieved);