From 3d0eb9b632d14518d54f862071760b3b401f78e7 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Tue, 15 Mar 2022 16:01:30 +0100 Subject: [PATCH] Fix energy SO129 0 --- tasmota/xdrv_03_energy.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasmota/xdrv_03_energy.ino b/tasmota/xdrv_03_energy.ino index d7b668d78..934714691 100644 --- a/tasmota/xdrv_03_energy.ino +++ b/tasmota/xdrv_03_energy.ino @@ -142,8 +142,8 @@ char* EnergyFormat(char* result, float* input, uint32_t resolution, uint32_t sin // single = 7 - single &0x03 = 3 - [xx,xx,xx] uint32_t index = (single > 3) ? single &0x03 : (0 == single) ? Energy.phase_count : 1; // 1,2,3 if (single > 2) { single = 0; } // 0,1,2 + float input_sum = 0.0; if (single > 1) { - float input_sum = 0.0; if (!Settings->flag5.energy_phase) { // SetOption129 - (Energy) Show phase information for (uint32_t i = 0; i < Energy.phase_count; i++) { input_sum += input[i]; @@ -164,8 +164,8 @@ char* WebEnergyFormat(char* result, float* input, uint32_t resolution, uint32_t // single = 0 - Energy.phase_count - xx / xx / xx or multi column // single = 1 - Energy.voltage_common or Energy.frequency_common - xx or single column using colspan (if needed) // single = 2 - Sum of Energy.phase_count - xx or single column using colspan (if needed) + float input_sum = 0.0; if (single > 1) { // Sum and/or Single column - float input_sum = 0.0; if (!Settings->flag5.energy_phase) { // SetOption129 - (Energy) Show phase information for (uint32_t i = 0; i < Energy.phase_count; i++) { input_sum += input[i];