Browse Source

Update RestApi.h

fix parse power & add battswitch fix
pull/1654/head^2
DanielR92 10 months ago
committed by GitHub
parent
commit
8f9cbfc741
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      src/web/RestApi.h

6
src/web/RestApi.h

@ -866,7 +866,7 @@ class RestApi {
// Advanced
objGroup[F("setPoint")] = (int16_t)mConfig->plugin.zeroExport.groups[group].setPoint;
objGroup[F("minimum")] = (bool)mConfig->plugin.zeroExport.groups[group].minimum;
objGroup[F("power")] = (int32_t)mConfig->plugin.zeroExport.groups[group].power;
objGroup[F("power")] = (float)mConfig->plugin.zeroExport.groups[group].power;
objGroup[F("powerTolerance")] = (uint8_t)mConfig->plugin.zeroExport.groups[group].powerTolerance;
objGroup[F("powerMax")] = (uint16_t)mConfig->plugin.zeroExport.groups[group].powerMax;
objGroup[F("Kp")] = ah::round3((float)mConfig->plugin.zeroExport.groups[group].Kp);
@ -1146,8 +1146,8 @@ class RestApi {
// Plugin ZeroExport
#if defined(PLUGIN_ZEROEXPORT)
else if(F("ze_batt_onff") == jsonIn[F("cmd")]) {
uint8_t group = jsonIn[F("id")];
mConfig->plugin.zeroExport.groups[group].battSwitch = (bool)jsonIn[F("battSwitch")];
uint8_t group = (uint8_t)jsonIn[F("id")];
mConfig->plugin.zeroExport.groups[group].battSwitch = (bool)jsonIn[F("val")];
}
else if(F("ze_save_group") == jsonIn[F("cmd")]) {
// General

Loading…
Cancel
Save