Apply limit instantaneously if inverter info is available
This commit is contained in:
parent
9b68eb6beb
commit
e1690e8f74
@ -48,9 +48,14 @@ bool ActivePowerControlCommand::handleResponse(InverterAbstract* inverter, fragm
|
||||
|
||||
if ((getType() == PowerLimitControlType::RelativNonPersistent) || (getType() == PowerLimitControlType::RelativPersistent)) {
|
||||
inverter->SystemConfigPara()->setLimitPercent(getLimit());
|
||||
} else {
|
||||
uint16_t max_power = inverter->DevInfo()->getMaxPower();
|
||||
if (max_power > 0) {
|
||||
inverter->SystemConfigPara()->setLimitPercent(static_cast<float>(getLimit()) / max_power * 100);
|
||||
} else {
|
||||
// TODO(tbnobody): Not implemented yet because we only can publish the percentage value
|
||||
}
|
||||
}
|
||||
inverter->SystemConfigPara()->setLastUpdateCommand(millis());
|
||||
inverter->SystemConfigPara()->setLastLimitCommandSuccess(CMD_OK);
|
||||
return true;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user