feat: added opentherm option for filtering numeric values

This commit is contained in:
Yurii
2024-10-10 21:08:13 +03:00
parent 282a02ecdb
commit 3c69f1295e
6 changed files with 78 additions and 10 deletions

View File

@@ -355,6 +355,7 @@ void settingsToJson(const Settings& src, JsonVariant dst, bool safe = false) {
dst["opentherm"]["getMinMaxTemp"] = src.opentherm.getMinMaxTemp;
dst["opentherm"]["nativeHeatingControl"] = src.opentherm.nativeHeatingControl;
dst["opentherm"]["immergasFix"] = src.opentherm.immergasFix;
dst["opentherm"]["filteringNumValues"] = src.opentherm.filteringNumValues;
dst["mqtt"]["enable"] = src.mqtt.enable;
dst["mqtt"]["server"] = src.mqtt.server;
@@ -810,6 +811,15 @@ bool jsonToSettings(const JsonVariantConst src, Settings& dst, bool safe = false
}
}
if (src["opentherm"]["filteringNumValues"].is<bool>()) {
bool value = src["opentherm"]["filteringNumValues"].as<bool>();
if (value != dst.opentherm.filteringNumValues) {
dst.opentherm.filteringNumValues = value;
changed = true;
}
}
// mqtt
if (src["mqtt"]["enable"].is<bool>()) {