Skip activating/deactivating Vicare standby preset (#106476)

This commit is contained in:
Bart Janssens 2023-12-28 09:31:35 +01:00 committed by Bram Kragten
parent 8e4fade725
commit 924e47c2a8

View file

@ -311,8 +311,11 @@ class ViCareClimate(ViCareEntity, ClimateEntity):
)
_LOGGER.debug("Current preset %s", self._current_program)
if self._current_program and self._current_program != VICARE_PROGRAM_NORMAL:
# We can't deactivate "normal"
if self._current_program and self._current_program not in [
VICARE_PROGRAM_NORMAL,
VICARE_PROGRAM_STANDBY,
]:
# We can't deactivate "normal" or "standby"
_LOGGER.debug("deactivating %s", self._current_program)
try:
self._circuit.deactivateProgram(self._current_program)
@ -326,8 +329,11 @@ class ViCareClimate(ViCareEntity, ClimateEntity):
) from err
_LOGGER.debug("Setting preset to %s / %s", preset_mode, target_program)
if target_program != VICARE_PROGRAM_NORMAL:
# And we can't explicitly activate "normal", either
if target_program not in [
VICARE_PROGRAM_NORMAL,
VICARE_PROGRAM_STANDBY,
]:
# And we can't explicitly activate "normal" or "standby", either
_LOGGER.debug("activating %s", target_program)
try:
self._circuit.activateProgram(target_program)