mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-11 18:54:28 +05:00
refactor: optimization of OT requests for CH2
This commit is contained in:
@@ -1038,25 +1038,27 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set CH2 temp
|
// Set CH2 temp
|
||||||
if (vars.master.ch2.enabled && !settings.opentherm.nativeHeatingControl) {
|
if (!settings.opentherm.nativeHeatingControl && vars.master.ch2.enabled) {
|
||||||
// Converted target CH2 temp
|
if (settings.opentherm.heatingCh1ToCh2 || settings.opentherm.dhwToCh2) {
|
||||||
float convertedTemp = convertTemp(
|
// Converted target CH2 temp
|
||||||
vars.master.ch2.targetTemp,
|
float convertedTemp = convertTemp(
|
||||||
settings.system.unitSystem,
|
vars.master.ch2.targetTemp,
|
||||||
settings.opentherm.unitSystem
|
settings.system.unitSystem,
|
||||||
);
|
settings.opentherm.unitSystem
|
||||||
|
);
|
||||||
|
|
||||||
if (this->needSetCh2Temp(convertedTemp)) {
|
if (this->needSetCh2Temp(convertedTemp)) {
|
||||||
if (this->setCh2Temp(convertedTemp)) {
|
if (this->setCh2Temp(convertedTemp)) {
|
||||||
this->ch2SetTempTime = millis();
|
this->ch2SetTempTime = millis();
|
||||||
|
|
||||||
Log.sinfoln(
|
Log.sinfoln(
|
||||||
FPSTR(L_OT_CH2), F("Set temp: %.2f (converted: %.2f, response: %.2f)"),
|
FPSTR(L_OT_CH2), F("Set temp: %.2f (converted: %.2f, response: %.2f)"),
|
||||||
vars.master.ch2.targetTemp, convertedTemp, vars.slave.ch2.targetTemp
|
vars.master.ch2.targetTemp, convertedTemp, vars.slave.ch2.targetTemp
|
||||||
);
|
);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Log.swarningln(FPSTR(L_OT_CH2), F("Failed set temp"));
|
Log.swarningln(FPSTR(L_OT_CH2), F("Failed set temp"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user