Browse Source

Bugfix: Negativer SetPoint

pull/1537/head
Patrick Amrhein 10 months ago
parent
commit
c1792b0f18
  1. 4
      src/config/settings.h
  2. 2
      src/web/RestApi.h
  3. 2
      src/web/html/setup.html

4
src/config/settings.h

@ -287,7 +287,7 @@ typedef struct {
float battVoltageOn;
float battVoltageOff;
// Advanced
uint16_t setPoint;
int16_t setPoint;
uint8_t refresh;
uint8_t powerTolerance;
uint16_t powerMax;
@ -1062,7 +1062,7 @@ class settings {
getVal<float>(obj, F("battVoltageOff"), &mCfg.plugin.zeroExport.groups[group].battVoltageOff);
// Advanced
if (obj.containsKey(F("setPoint")))
getVal<uint16_t>(obj, F("setPoint"), &mCfg.plugin.zeroExport.groups[group].setPoint);
getVal<int16_t>(obj, F("setPoint"), &mCfg.plugin.zeroExport.groups[group].setPoint);
if (obj.containsKey(F("refresh")))
getVal<uint8_t>(obj, F("refresh"), &mCfg.plugin.zeroExport.groups[group].refresh);
if (obj.containsKey(F("powerTolerance")))

2
src/web/RestApi.h

@ -845,7 +845,7 @@ class RestApi {
objGroup[F("battVoltageOn")] = ah::round1((float)mConfig->plugin.zeroExport.groups[group].battVoltageOn);
objGroup[F("battVoltageOff")] = ah::round1((float)mConfig->plugin.zeroExport.groups[group].battVoltageOff);
// Advanced
objGroup[F("setPoint")] = (uint16_t)mConfig->plugin.zeroExport.groups[group].setPoint;
objGroup[F("setPoint")] = (int16_t)mConfig->plugin.zeroExport.groups[group].setPoint;
objGroup[F("refresh")] = (uint8_t)mConfig->plugin.zeroExport.groups[group].refresh;
objGroup[F("powerTolerance")] = (uint8_t)mConfig->plugin.zeroExport.groups[group].powerTolerance;
objGroup[F("powerMax")] = (uint16_t)mConfig->plugin.zeroExport.groups[group].powerMax;

2
src/web/html/setup.html

@ -1414,7 +1414,7 @@
]),
// Advanced
ml("div", {id: "div{#ZE_GROUP_TAB_ADVANCED}", class: "tab-content hide"}, [
divRow("{#ZE_GROUP_TAB_ADVANCED_SETPOINT}", ml("input", {name: "setPoint", class: "text", type: "number", min: "0", max: "65535", value: obj.setPoint}, null)),
divRow("{#ZE_GROUP_TAB_ADVANCED_SETPOINT}", ml("input", {name: "setPoint", class: "text", type: "number", min: "-32768", max: "32767", step: "1", value: obj.setPoint}, null)),
divRow("{#ZE_GROUP_TAB_ADVANCED_REFRESH}", ml("input", {name: "refresh", class: "text", type: "number", min: "0", max: "255", value: obj.refresh}, null)),
divRow("{#ZE_GROUP_TAB_ADVANCED_POWERTOLERANCE}", ml("input", {name: "powerTolerance", class: "text", type: "number", min: "0", max: "255", value: obj.powerTolerance}, null)),
divRow("{#ZE_GROUP_TAB_ADVANCED_POWERMAX}", ml("input", {name: "powerMax", class: "text", type: "number", min: "0", max: "65535", value: obj.powerMax}, null)),

Loading…
Cancel
Save