Make change in serial.htm and webApi.cpp

This commit is contained in:
DanielR92 2022-10-11 19:42:31 +02:00
parent 7c7a7d25b8
commit c3d81d36c6
3 changed files with 33 additions and 39 deletions

View file

@ -336,8 +336,9 @@ bool webApi::setCtrl(DynamicJsonDocument jsonIn, JsonObject jsonOut) {
// Todo: num is the inverter number 0-3. For better display in DPRINTLN
uint8_t num = jsonIn[F("inverter")];
uint8_t tx_request = jsonIn[F("tx_request")];
if(TX_REQ_DEVCONTROL == jsonIn[F("tx_request")])
if(TX_REQ_DEVCONTROL == tx_request)
{
DPRINTLN(DBG_INFO, F("devcontrol [") + String(num) + F("], cmd: 0x") + String(cmd, HEX));
@ -365,6 +366,8 @@ bool webApi::setCtrl(DynamicJsonDocument jsonIn, JsonObject jsonOut) {
iv->devControlRequest = true;
break;
case ActivePowerContr:
iv->devControlCmd = ActivePowerContr;
iv->devControlRequest = true;
iv->powerLimit[0] = payload[0];
iv->powerLimit[1] = payload[1];
break;