WebAPI: Add status of last set limit command
This commit is contained in:
parent
4fd2f3ca78
commit
dcaadf26a9
@ -36,6 +36,19 @@ void WebApiLimitClass::onLimitStatus(AsyncWebServerRequest* request)
|
|||||||
((uint32_t)(inv->serial() & 0xFFFFFFFF)));
|
((uint32_t)(inv->serial() & 0xFFFFFFFF)));
|
||||||
|
|
||||||
root[buffer]["limit"] = inv->SystemConfigPara()->getLimitPercent();
|
root[buffer]["limit"] = inv->SystemConfigPara()->getLimitPercent();
|
||||||
|
|
||||||
|
LastCommandSuccess status = inv->SystemConfigPara()->getLastLimitCommandSuccess();
|
||||||
|
String limitStatus = "Unknown";
|
||||||
|
if (status == LastCommandSuccess::CMD_OK) {
|
||||||
|
limitStatus = "Ok";
|
||||||
|
}
|
||||||
|
else if (status == LastCommandSuccess::CMD_NOK) {
|
||||||
|
limitStatus = "Failure";
|
||||||
|
}
|
||||||
|
else if (status == LastCommandSuccess::CMD_PENDING) {
|
||||||
|
limitStatus = "Pending";
|
||||||
|
}
|
||||||
|
root[buffer]["limit_set_status"] = limitStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
response->setLength();
|
response->setLength();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user