From d729016c2121fc1fb39f9e89dd2d772319db22f4 Mon Sep 17 00:00:00 2001 From: TheJulianJES Date: Wed, 25 Feb 2026 03:16:26 +0100 Subject: [PATCH] Remove request `isinstance` `Exception` checks from switch --- zha/application/platforms/switch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zha/application/platforms/switch.py b/zha/application/platforms/switch.py index d3f60f4f8..e4a6b4b11 100644 --- a/zha/application/platforms/switch.py +++ b/zha/application/platforms/switch.py @@ -292,7 +292,7 @@ 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() @@ -300,7 +300,7 @@ async def async_turn_on(self) -> None: 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()