From bca4211500a7a5dde013dd89b549a33ab9983eaa Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sun, 27 Oct 2024 15:32:40 +0100 Subject: [PATCH] Fix ESP32 energy margins reporting when powered off --- tasmota/tasmota_xdrv_driver/xdrv_03_esp32_energy.ino | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_03_esp32_energy.ino b/tasmota/tasmota_xdrv_driver/xdrv_03_esp32_energy.ino index 26e7ec27f..5d03055b7 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_03_esp32_energy.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_03_esp32_energy.ino @@ -821,12 +821,12 @@ void EnergyMarginCheck(void) { jsonflg = true; } } - if (jsonflg) { - ResponseJsonEndEnd(); - MqttPublishTele(PSTR(D_RSLT_MARGINS)); - EnergyMqttShow(); - Energy->margin_stable = 3; // Allow 2 seconds to stabilize before reporting - } + } + if (jsonflg) { + ResponseJsonEndEnd(); + MqttPublishTele(PSTR(D_RSLT_MARGINS)); + EnergyMqttShow(); + Energy->margin_stable = 3; // Allow 2 seconds to stabilize before reporting } // Max Power