feat: improved turbo mode

- added turbo factor parameter
- implemented turbo mode for PID
This commit is contained in:
Yurii
2024-10-31 05:22:41 +03:00
parent acd8348a5b
commit f86857c279
6 changed files with 51 additions and 37 deletions

View File

@@ -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>();