mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Catch vicare errors when deactivating preset fails (#84778)
vicare: catch errors when deactivating preset fails
This commit is contained in:
parent
f84533838a
commit
235a34c10c
@ -6,6 +6,7 @@ import logging
|
|||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from PyViCare.PyViCareUtils import (
|
from PyViCare.PyViCareUtils import (
|
||||||
|
PyViCareCommandError,
|
||||||
PyViCareInvalidDataError,
|
PyViCareInvalidDataError,
|
||||||
PyViCareNotSupportedFeatureError,
|
PyViCareNotSupportedFeatureError,
|
||||||
PyViCareRateLimitError,
|
PyViCareRateLimitError,
|
||||||
@ -354,7 +355,10 @@ class ViCareClimate(ClimateEntity):
|
|||||||
_LOGGER.debug("Setting preset to %s / %s", preset_mode, vicare_program)
|
_LOGGER.debug("Setting preset to %s / %s", preset_mode, vicare_program)
|
||||||
if self._current_program != VICARE_PROGRAM_NORMAL:
|
if self._current_program != VICARE_PROGRAM_NORMAL:
|
||||||
# We can't deactivate "normal"
|
# We can't deactivate "normal"
|
||||||
|
try:
|
||||||
self._circuit.deactivateProgram(self._current_program)
|
self._circuit.deactivateProgram(self._current_program)
|
||||||
|
except PyViCareCommandError:
|
||||||
|
_LOGGER.debug("Unable to deactivate program %s", self._current_program)
|
||||||
if vicare_program != VICARE_PROGRAM_NORMAL:
|
if vicare_program != VICARE_PROGRAM_NORMAL:
|
||||||
# And we can't explicitly activate normal, either
|
# And we can't explicitly activate normal, either
|
||||||
self._circuit.activateProgram(vicare_program)
|
self._circuit.activateProgram(vicare_program)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user