* fix read back of limit value, now with one decimal place
This commit is contained in:
lumapu 2024-03-10 13:26:20 +01:00
parent 7b030a39d5
commit 3dd1b4e73b
7 changed files with 12 additions and 4 deletions

View file

@ -499,7 +499,7 @@ class RestApi {
obj[F("name")] = String(iv->config->name);
obj[F("serial")] = String(iv->config->serial.u64, HEX);
obj[F("version")] = String(iv->getFwVersion());
obj[F("power_limit_read")] = iv->actPowerLimit;
obj[F("power_limit_read")] = ah::round1(iv->getChannelFieldValue(CH0, FLD_ACT_ACTIVE_PWR_LIMIT, iv->getRecordStruct(SystemConfigPara)));
obj[F("power_limit_ack")] = iv->powerLimitAck;
obj[F("max_pwr")] = iv->getMaxPower();
obj[F("ts_last_success")] = rec->ts;

View file

@ -116,7 +116,7 @@
if(65535 != obj.power_limit_read) {
pwrLimit = obj.power_limit_read + " %";
if(0 != obj.max_pwr)
pwrLimit += ", " + Math.round(obj.max_pwr * obj.power_limit_read / 100) + " W";
pwrLimit += ", " + (obj.max_pwr * obj.power_limit_read / 100) + " W";
}
var maxAcPwr = toIsoDateStr(new Date(obj.ts_max_ac_pwr * 1000));