From 12f7caf99805479aadbd738fae98f7d25488e080 Mon Sep 17 00:00:00 2001 From: Bernhard Kirchen Date: Sat, 23 Mar 2024 22:10:26 +0100 Subject: [PATCH] fix: HTTP power meter: retrieve multiple JSON paths if only a single request was made (switch "Individual HTTP requests per phase" is off), the user could still enable phase 2 and phase 3 config and configure a respective JSON path. however, the value was never extracted from the successful HTTP request for phase 1. closes #637. --- src/HttpPowerMeter.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/HttpPowerMeter.cpp b/src/HttpPowerMeter.cpp index c42efd20e..cb829e1d7 100644 --- a/src/HttpPowerMeter.cpp +++ b/src/HttpPowerMeter.cpp @@ -38,6 +38,13 @@ bool HttpPowerMeterClass::updateValues() MessageOutput.printf("%s\r\n", httpPowerMeterError); return false; } + continue; + } + + if(!tryGetFloatValueForPhase(i, phaseConfig.JsonPath)) { + MessageOutput.printf("[HttpPowerMeter] Getting the power of phase %d (from JSON fetched with Phase 1 config) failed.\r\n", i + 1); + MessageOutput.printf("%s\r\n", httpPowerMeterError); + return false; } } return true;