mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-10 18:24:27 +05:00
feat: added correction coeff. settings for pressure and dhw flow rate
This commit is contained in:
20
src/utils.h
20
src/utils.h
@@ -345,6 +345,8 @@ void settingsToJson(const Settings& src, JsonVariant dst, bool safe = false) {
|
||||
dst["opentherm"]["faultStateGpio"] = src.opentherm.faultStateGpio;
|
||||
dst["opentherm"]["invertFaultState"] = src.opentherm.invertFaultState;
|
||||
dst["opentherm"]["memberIdCode"] = src.opentherm.memberIdCode;
|
||||
dst["opentherm"]["pressureMultiplier"] = roundd(src.opentherm.pressureMultiplier, 2);
|
||||
dst["opentherm"]["dhwFlowRateMultiplier"] = roundd(src.opentherm.dhwFlowRateMultiplier, 2);
|
||||
dst["opentherm"]["dhwPresent"] = src.opentherm.dhwPresent;
|
||||
dst["opentherm"]["summerWinterMode"] = src.opentherm.summerWinterMode;
|
||||
dst["opentherm"]["heatingCh2Enabled"] = src.opentherm.heatingCh2Enabled;
|
||||
@@ -695,6 +697,24 @@ bool jsonToSettings(const JsonVariantConst src, Settings& dst, bool safe = false
|
||||
}
|
||||
}
|
||||
|
||||
if (!src["opentherm"]["pressureMultiplier"].isNull()) {
|
||||
float value = src["opentherm"]["pressureMultiplier"].as<float>();
|
||||
|
||||
if (value > 0 && value <= 100 && fabs(value - dst.opentherm.pressureMultiplier) > 0.0001f) {
|
||||
dst.opentherm.pressureMultiplier = roundd(value, 2);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!src["opentherm"]["dhwFlowRateMultiplier"].isNull()) {
|
||||
float value = src["opentherm"]["dhwFlowRateMultiplier"].as<float>();
|
||||
|
||||
if (value > 0 && value <= 100 && fabs(value - dst.opentherm.dhwFlowRateMultiplier) > 0.0001f) {
|
||||
dst.opentherm.dhwFlowRateMultiplier = roundd(value, 2);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (src["opentherm"]["dhwPresent"].is<bool>()) {
|
||||
bool value = src["opentherm"]["dhwPresent"].as<bool>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user