Improve type hints in omnilogic (#145259)

This commit is contained in:
epenet 2025-05-20 00:21:44 +02:00 committed by GitHub
parent f700a1faa3
commit f4b0baecd3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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()