ensure only one PowerCommand and ActivePowerCommand is queued
neither a PowerCommand nor an ActivePowerCommand shall be enqueued if another one is already pending.
This commit is contained in:
parent
8433820529
commit
8b23324693
@ -121,6 +121,10 @@ bool HM_Abstract::sendActivePowerControlRequest(float limit, PowerLimitControlTy
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CMD_PENDING == SystemConfigPara()->getLastLimitCommandSuccess()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (type == PowerLimitControlType::RelativNonPersistent || type == PowerLimitControlType::RelativPersistent) {
|
if (type == PowerLimitControlType::RelativNonPersistent || type == PowerLimitControlType::RelativPersistent) {
|
||||||
limit = min<float>(100, limit);
|
limit = min<float>(100, limit);
|
||||||
}
|
}
|
||||||
@ -147,6 +151,10 @@ bool HM_Abstract::sendPowerControlRequest(bool turnOn)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CMD_PENDING == PowerCommand()->getLastPowerCommandSuccess()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (turnOn) {
|
if (turnOn) {
|
||||||
_powerState = 1;
|
_powerState = 1;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user