mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-10 18:24:27 +05:00
refactor: cosmetic changes; move maxModulation setting to opentherm section
This commit is contained in:
20
src/utils.h
20
src/utils.h
@@ -345,6 +345,7 @@ 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"]["maxModulation"] = src.opentherm.maxModulation;
|
||||
dst["opentherm"]["pressureFactor"] = roundd(src.opentherm.pressureFactor, 2);
|
||||
dst["opentherm"]["dhwFlowRateFactor"] = roundd(src.opentherm.dhwFlowRateFactor, 2);
|
||||
dst["opentherm"]["minPower"] = roundd(src.opentherm.minPower, 2);
|
||||
@@ -388,7 +389,6 @@ void settingsToJson(const Settings& src, JsonVariant dst, bool safe = false) {
|
||||
dst["heating"]["hysteresis"] = roundd(src.heating.hysteresis, 2);
|
||||
dst["heating"]["minTemp"] = src.heating.minTemp;
|
||||
dst["heating"]["maxTemp"] = src.heating.maxTemp;
|
||||
dst["heating"]["maxModulation"] = src.heating.maxModulation;
|
||||
|
||||
dst["dhw"]["enable"] = src.dhw.enable;
|
||||
dst["dhw"]["target"] = roundd(src.dhw.target, 1);
|
||||
@@ -700,6 +700,15 @@ bool jsonToSettings(const JsonVariantConst src, Settings& dst, bool safe = false
|
||||
}
|
||||
}
|
||||
|
||||
if (!src["opentherm"]["maxModulation"].isNull()) {
|
||||
unsigned char value = src["opentherm"]["maxModulation"].as<unsigned char>();
|
||||
|
||||
if (value > 0 && value <= 100 && value != dst.opentherm.maxModulation) {
|
||||
dst.opentherm.maxModulation = value;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!src["opentherm"]["pressureFactor"].isNull()) {
|
||||
float value = src["opentherm"]["pressureFactor"].as<float>();
|
||||
|
||||
@@ -1205,15 +1214,6 @@ bool jsonToSettings(const JsonVariantConst src, Settings& dst, bool safe = false
|
||||
}
|
||||
}
|
||||
|
||||
if (!src["heating"]["maxModulation"].isNull()) {
|
||||
unsigned char value = src["heating"]["maxModulation"].as<unsigned char>();
|
||||
|
||||
if (value > 0 && value <= 100 && value != dst.heating.maxModulation) {
|
||||
dst.heating.maxModulation = value;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// dhw
|
||||
if (src["dhw"]["enable"].is<bool>()) {
|
||||
|
||||
Reference in New Issue
Block a user