From f4b0baecd33c86754237af36abd426934da57592 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 20 May 2025 00:21:44 +0200 Subject: [PATCH] Improve type hints in omnilogic (#145259) --- homeassistant/components/omnilogic/switch.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/omnilogic/switch.py b/homeassistant/components/omnilogic/switch.py index a9f8bc77d8a..9583194f41b 100644 --- a/homeassistant/components/omnilogic/switch.py +++ b/homeassistant/components/omnilogic/switch.py @@ -92,12 +92,12 @@ class OmniLogicSwitch(OmniLogicEntity, SwitchEntity): ) self._state_key = state_key - self._state = None - self._last_action = 0 + self._state: bool | None = None + self._last_action = 0.0 self._state_delay = 30 @property - def is_on(self): + def is_on(self) -> bool: """Return the on/off state of the switch.""" state_int = 0 @@ -119,7 +119,7 @@ class OmniLogicSwitch(OmniLogicEntity, SwitchEntity): class OmniLogicRelayControl(OmniLogicSwitch): """Define the OmniLogic Relay entity.""" - async def async_turn_on(self, **kwargs): + async def async_turn_on(self, **kwargs: Any) -> None: """Turn on the relay.""" self._state = True self._last_action = time.time() @@ -132,7 +132,7 @@ class OmniLogicRelayControl(OmniLogicSwitch): 1, ) - async def async_turn_off(self, **kwargs): + async def async_turn_off(self, **kwargs: Any) -> None: """Turn off the relay.""" self._state = False self._last_action = time.time() @@ -178,7 +178,7 @@ class OmniLogicPumpControl(OmniLogicSwitch): self._last_speed = None - async def async_turn_on(self, **kwargs): + async def async_turn_on(self, **kwargs: Any) -> None: """Turn on the pump.""" self._state = True self._last_action = time.time() @@ -196,7 +196,7 @@ class OmniLogicPumpControl(OmniLogicSwitch): on_value, ) - async def async_turn_off(self, **kwargs): + async def async_turn_off(self, **kwargs: Any) -> None: """Turn off the pump.""" self._state = False self._last_action = time.time()