Feature: Set Limit transfer only to "OK" if the queue does not contain any more commands
This commit is contained in:
parent
8acae28c59
commit
5265c6281f
@ -161,6 +161,11 @@ void HoymilesRadio::removeCommands(InverterAbstract* inv)
|
||||
_commandQueue.removeAllEntriesForInverter(inv);
|
||||
}
|
||||
|
||||
uint8_t HoymilesRadio::countSimilarCommands(std::shared_ptr<CommandAbstract> cmd)
|
||||
{
|
||||
return _commandQueue.countSimilarCommands(cmd);
|
||||
}
|
||||
|
||||
bool HoymilesRadio::isIdle() const
|
||||
{
|
||||
return !_busyFlag;
|
||||
|
||||
@ -24,6 +24,7 @@ public:
|
||||
bool isInitialized() const;
|
||||
|
||||
void removeCommands(InverterAbstract* inv);
|
||||
uint8_t countSimilarCommands(std::shared_ptr<CommandAbstract> cmd);
|
||||
|
||||
void enqueCommand(std::shared_ptr<CommandAbstract> cmd)
|
||||
{
|
||||
|
||||
@ -87,7 +87,10 @@ bool ActivePowerControlCommand::handleResponse(const fragment_t fragment[], cons
|
||||
}
|
||||
}
|
||||
_inv->SystemConfigPara()->setLastUpdateCommand(millis());
|
||||
_inv->SystemConfigPara()->setLastLimitCommandSuccess(CMD_OK);
|
||||
std::shared_ptr<ActivePowerControlCommand> cmd(std::shared_ptr<ActivePowerControlCommand>(), this);
|
||||
if (_inv->getRadio()->countSimilarCommands(cmd) == 1) {
|
||||
_inv->SystemConfigPara()->setLastLimitCommandSuccess(CMD_OK);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user