Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions zha/application/platforms/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,15 +292,15 @@ def is_on(self) -> bool:
async def async_turn_on(self) -> None:
"""Turn the entity on."""
result = await self._on_off_cluster_handler.on()
if isinstance(result, Exception) or result[1] is not Status.SUCCESS:
if result[1] is not Status.SUCCESS:
return
self._state = True
self.maybe_emit_state_changed_event()

async def async_turn_off(self) -> None:
"""Turn the entity off."""
result = await self._on_off_cluster_handler.off()
if isinstance(result, Exception) or result[1] is not Status.SUCCESS:
if result[1] is not Status.SUCCESS:
return
self._state = False
self.maybe_emit_state_changed_event()
Expand Down
Loading