Skip to content

Commit

Permalink
fix: HTTP power meter: retrieve multiple JSON paths
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
schlimmchen committed Mar 23, 2024
1 parent b8d0998 commit 12f7caf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/HttpPowerMeter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 12f7caf

Please sign in to comment.