From fdbf08dbc4d84a13c7a441abfd16b0ef5c9b0218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Nyi=CC=81ri?= Date: Thu, 1 Aug 2024 19:28:05 +0200 Subject: [PATCH] Add #641: Raise exception on failure to trigger the siren. --- custom_components/tapo_control/siren.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/custom_components/tapo_control/siren.py b/custom_components/tapo_control/siren.py index 0920a04..c9856e2 100644 --- a/custom_components/tapo_control/siren.py +++ b/custom_components/tapo_control/siren.py @@ -114,6 +114,7 @@ async def _turn_off_after(seconds: int, send: bool) -> None: if result_has_error(result) and result_has_error(result2): self._attr_available = False + raise Exception("Camera does not support triggering the siren.") else: self._is_on = True if duration: @@ -155,7 +156,7 @@ async def async_turn_off(self, send: bool | None = True, **kwargs) -> None: LOGGER.debug(e) if result_has_error(result) and result_has_error(result2): self._attr_available = False - + raise Exception("Camera does not support triggering the siren.") self._attr_is_on = False self.async_write_ha_state()