Skip to content

Commit

Permalink
Add #641: Raise exception on failure to trigger the siren.
Browse files Browse the repository at this point in the history
  • Loading branch information
JurajNyiri committed Aug 1, 2024
1 parent f237052 commit fdbf08d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion custom_components/tapo_control/siren.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit fdbf08d

Please sign in to comment.