mirror of
https://github.com/Laxilef/OTGateway.git
synced 2026-11-25 07:43:04 +05:00
refactor: clarify CH2 setpoint scheduling
This commit is contained in:
1 parent
1d1a57ecad
commit
7dc803bd99
1 file changed
+16
-5
+16
-5
@@ -1937,10 +1937,20 @@ void initOpenTherm() {
|
||||
// Write the CH2 water temperature setpoint.
|
||||
writeCh2SetpointTask.setInterval(750)
|
||||
.setEnabledWhen([] {
|
||||
return isSlaveReady() &&
|
||||
(settings.opentherm.options.heatingToCh2 || settings.opentherm.options.dhwToCh2 ||
|
||||
(!vars.master.ch2.enabled && settings.opentherm.ch2DisablingAction != ChannelDisablingAction::OFF)) &&
|
||||
needWriteCh2Setpoint(getCh2ChannelSetpoint());
|
||||
if (!isSlaveReady()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (settings.opentherm.options.heatingToCh2 || settings.opentherm.options.dhwToCh2) {
|
||||
return needWriteCh2Setpoint(getCh2ChannelSetpoint());
|
||||
}
|
||||
|
||||
// Without mirroring, only write the setpoint to disable CH2.
|
||||
if (!vars.master.ch2.enabled && settings.opentherm.ch2DisablingAction != ChannelDisablingAction::OFF) {
|
||||
return needWriteCh2Setpoint(getCh2ChannelSetpoint());
|
||||
}
|
||||
|
||||
return false;
|
||||
})
|
||||
.onDone(onOperationDone);
|
||||
openthermTaskManager.addTask(writeCh2SetpointTask);
|
||||
@@ -1959,7 +1969,8 @@ void initOpenTherm() {
|
||||
writeRoomSetpointCh2Task.setInterval(750)
|
||||
.setEnabledWhen([] {
|
||||
return isSlaveReady() &&
|
||||
settings.opentherm.options.nativeOTC && settings.opentherm.options.heatingToCh2 &&
|
||||
settings.opentherm.options.nativeOTC &&
|
||||
settings.opentherm.options.heatingToCh2 &&
|
||||
needWriteRoomSetpointCh2(vars.master.heating.targetTemp);
|
||||
})
|
||||
.onDone(onOperationDone);
|
||||
|
||||
Reference in new issue
Block a user