Gisteresis termostat

This commit is contained in:
Dmitry Borisenko
2020-12-09 04:08:36 +03:00
parent 6e44f76385
commit 6205f6959c
31 changed files with 257 additions and 741 deletions

View File

@@ -30,7 +30,28 @@ public:
String setEventSign = selectFromMarkerToMarker(condition, " ", 1);
String setEventValue = selectFromMarkerToMarker(condition, " ", 2);
if (!isDigitStr(setEventValue)) setEventValue = getValue(setEventValue); //jsonReadStr(configLiveJson , setEventValue);
if (!isDigitStr(setEventValue)) {
if (setEventValue.indexOf("+-") != -1) {
String setEventValueName = selectToMarker(setEventValue, "+-");
String gisteresisValue = selectToMarkerLast(setEventValue, "+-");
gisteresisValue.replace("+-", "");
String value = getValue(setEventValueName);
String upValue = String(value.toFloat() + gisteresisValue.toFloat());
String lowValue = String(value.toFloat() - gisteresisValue.toFloat());
if (setEventSign == ">") {
setEventValue = upValue;
}
else if (setEventSign == "<") {
setEventValue = lowValue;
}
}
else {
setEventValue = getValue(setEventValue);
}
}
boolean flag = false;