fixed long/float parsing bug

This commit is contained in:
Fribur 2024-01-04 16:32:42 -05:00
parent f5c69060f5
commit d5eba2392c

View File

@ -190,7 +190,7 @@ bool HttpPowerMeterClass::tryGetFloatValueForPhase(int phase, int httpCode, cons
{ {
snprintf_P(httpPowerMeterError, sizeof(httpPowerMeterError), PSTR("[HttpPowerMeter] Couldn't find a value for phase %i with Json query \"%s\""), phase, jsonPath); snprintf_P(httpPowerMeterError, sizeof(httpPowerMeterError), PSTR("[HttpPowerMeter] Couldn't find a value for phase %i with Json query \"%s\""), phase, jsonPath);
}else { }else {
power[phase] = json[jsonPath].as<long>(); power[phase] = json[jsonPath].as<float>();
//MessageOutput.printf("Power for Phase %i: %5.2fW\r\n", phase, power[phase]); //MessageOutput.printf("Power for Phase %i: %5.2fW\r\n", phase, power[phase]);
success = true; success = true;
} }