[Thermostat] Save and restore XdrvMailbox if output relay is switched off (#20405)

This commit is contained in:
Gregory Holder 2024-01-09 22:07:30 +01:00 committed by GitHub
parent fa959d9f47
commit 345de0aded
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -1442,7 +1442,9 @@ void CmndThermostatModeSet(void)
// Make sure the relay is switched to off once if the thermostat is being disabled,
// or it will get stuck on (danger!)
Thermostat[ctr_output].status.command_output = IFACE_OFF;
struct XDRVMAILBOX save_XdrvMailbox = XdrvMailbox;
ThermostatOutputRelay(ctr_output, Thermostat[ctr_output].status.command_output);
XdrvMailbox = save_XdrvMailbox;
}
if ((value > THERMOSTAT_OFF) && (value < THERMOSTAT_MODES_MAX)) {
DebugControllerParameters(ctr_output);