From 1b0778dc0aec06f94a722188b0ec70125159788a Mon Sep 17 00:00:00 2001 From: Florian Date: Thu, 9 Feb 2023 16:18:39 -0600 Subject: [PATCH] [LPM] - Update state (#1445) When issuing a low power mode change update the state to the controller --- docs/use/boards.md | 2 +- main/ZgatewayBT.ino | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/use/boards.md b/docs/use/boards.md index db80b36..9a06bb9 100644 --- a/docs/use/boards.md +++ b/docs/use/boards.md @@ -28,7 +28,7 @@ The interval between the ESP32 wake up is defined at build time by the macro `Ti ::: tip When coming back from mode 2 to mode 0 you may publish the command with a retain flag so as to enable the gateway to retrieve it when reconnecting. -A low power mode switch is automatically created by discovery with Home Assistant, you may experience a delay between the command and the state update due to the fact that the update is published every 2 minutes. +A low power mode switch is automatically created by discovery with Home Assistant, you may experience a delay between the command and the state update due to the fact that the update will be revceived and acknowledged when the device woke up. In low power mode you should use ESPWifiManualSetup so as to rely on the credentials entered into User_config.h. So as to do that uncomment the line below in User_config.h ``` c diff --git a/main/ZgatewayBT.ino b/main/ZgatewayBT.ino index 80cb71f..50299ef 100644 --- a/main/ZgatewayBT.ino +++ b/main/ZgatewayBT.ino @@ -802,6 +802,8 @@ void changelowpowermode(int newLowPowerMode) { preferences.begin(Gateway_Short_Name, false); preferences.putUInt("lowpowermode", lowpowermode); preferences.end(); + // Publish the states to update the controller switch status + stateMeasures(); } void setupBT() {