From b44040af0f30ec904d624771130546c6bd4e1c66 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sat, 26 Oct 2019 13:13:16 +0200 Subject: [PATCH] Bump version 6.7.1 * Fix on energy monitoring devices using PowerDelta Exception0 with epc1:0x4000dce5 = Divide by zero (#6750) * Fix Script array bug (#6751) --- sonoff/_changelog.ino | 5 +++++ sonoff/sonoff_version.h | 2 +- sonoff/xdrv_03_energy.ino | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sonoff/_changelog.ino b/sonoff/_changelog.ino index b964b449d..1cb954c7b 100644 --- a/sonoff/_changelog.ino +++ b/sonoff/_changelog.ino @@ -1,4 +1,9 @@ /*********************************************************************************************\ + * 6.7.1 20191026 + * Release + * Fix on energy monitoring devices using PowerDelta Exception0 with epc1:0x4000dce5 = Divide by zero (#6750) + * Fix Script array bug (#6751) + * * 6.7.0 20191025 * Release * diff --git a/sonoff/sonoff_version.h b/sonoff/sonoff_version.h index 1731d80a5..4780ef5e3 100644 --- a/sonoff/sonoff_version.h +++ b/sonoff/sonoff_version.h @@ -20,6 +20,6 @@ #ifndef _SONOFF_VERSION_H_ #define _SONOFF_VERSION_H_ -const uint32_t VERSION = 0x06070000; +const uint32_t VERSION = 0x06070100; #endif // _SONOFF_VERSION_H_ diff --git a/sonoff/xdrv_03_energy.ino b/sonoff/xdrv_03_energy.ino index aa580421d..263b2fa15 100644 --- a/sonoff/xdrv_03_energy.ino +++ b/sonoff/xdrv_03_energy.ino @@ -292,7 +292,7 @@ void EnergyMarginCheck(void) DEBUG_DRIVER_LOG(PSTR("NRG: Delta %d, Power %d"), delta, min_power); - if (delta) { // Fix divide by 0 exception (#6741) + if ((delta > 0) && (min_power > 0)) { // Fix divide by 0 exception (#6741) if (((Settings.energy_power_delta < 101) && (((delta * 100) / min_power) > Settings.energy_power_delta)) || // 1..100 = Percentage ((Settings.energy_power_delta > 100) && (delta > (Settings.energy_power_delta -100)))) { // 101..32000 = Absolute Energy.power_delta = true;