Avoid changing state of reduced preset in ViCare integration (#105642)

This commit is contained in:
Christopher Fenner 2023-12-28 11:17:13 +01:00 committed by GitHub
parent af881d7ac8
commit 6eec4998bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -313,9 +313,10 @@ class ViCareClimate(ViCareEntity, ClimateEntity):
_LOGGER.debug("Current preset %s", self._current_program)
if self._current_program and self._current_program not in [
VICARE_PROGRAM_NORMAL,
VICARE_PROGRAM_REDUCED,
VICARE_PROGRAM_STANDBY,
]:
# We can't deactivate "normal" or "standby"
# We can't deactivate "normal", "reduced" or "standby"
_LOGGER.debug("deactivating %s", self._current_program)
try:
self._circuit.deactivateProgram(self._current_program)
@ -331,9 +332,10 @@ class ViCareClimate(ViCareEntity, ClimateEntity):
_LOGGER.debug("Setting preset to %s / %s", preset_mode, target_program)
if target_program not in [
VICARE_PROGRAM_NORMAL,
VICARE_PROGRAM_REDUCED,
VICARE_PROGRAM_STANDBY,
]:
# And we can't explicitly activate "normal" or "standby", either
# And we can't explicitly activate "normal", "reduced" or "standby", either
_LOGGER.debug("activating %s", target_program)
try:
self._circuit.activateProgram(target_program)