mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-10 18:24:27 +05:00
feat: improved turbo mode
- added turbo factor parameter - implemented turbo mode for PID
This commit is contained in:
10
src/utils.h
10
src/utils.h
@@ -394,6 +394,7 @@ void settingsToJson(const Settings& src, JsonVariant dst, bool safe = false) {
|
||||
dst["heating"]["turbo"] = src.heating.turbo;
|
||||
dst["heating"]["target"] = roundd(src.heating.target, 2);
|
||||
dst["heating"]["hysteresis"] = roundd(src.heating.hysteresis, 2);
|
||||
dst["heating"]["turboFactor"] = roundd(src.heating.turboFactor, 2);
|
||||
dst["heating"]["minTemp"] = src.heating.minTemp;
|
||||
dst["heating"]["maxTemp"] = src.heating.maxTemp;
|
||||
|
||||
@@ -1106,6 +1107,15 @@ bool jsonToSettings(const JsonVariantConst src, Settings& dst, bool safe = false
|
||||
}
|
||||
}
|
||||
|
||||
if (!src["heating"]["turboFactor"].isNull()) {
|
||||
float value = src["heating"]["turboFactor"].as<float>();
|
||||
|
||||
if (value >= 1.5f && value <= 10.0f && fabs(value - dst.heating.turboFactor) > 0.0001f) {
|
||||
dst.heating.turboFactor = roundd(value, 2);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!src["heating"]["minTemp"].isNull()) {
|
||||
unsigned char value = src["heating"]["minTemp"].as<unsigned char>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user