mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 18:27:09 +00:00
Improve type hints in omnilogic (#145259)
This commit is contained in:
parent
f700a1faa3
commit
f4b0baecd3
@ -92,12 +92,12 @@ class OmniLogicSwitch(OmniLogicEntity, SwitchEntity):
|
|||||||
)
|
)
|
||||||
|
|
||||||
self._state_key = state_key
|
self._state_key = state_key
|
||||||
self._state = None
|
self._state: bool | None = None
|
||||||
self._last_action = 0
|
self._last_action = 0.0
|
||||||
self._state_delay = 30
|
self._state_delay = 30
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_on(self):
|
def is_on(self) -> bool:
|
||||||
"""Return the on/off state of the switch."""
|
"""Return the on/off state of the switch."""
|
||||||
state_int = 0
|
state_int = 0
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ class OmniLogicSwitch(OmniLogicEntity, SwitchEntity):
|
|||||||
class OmniLogicRelayControl(OmniLogicSwitch):
|
class OmniLogicRelayControl(OmniLogicSwitch):
|
||||||
"""Define the OmniLogic Relay entity."""
|
"""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."""
|
"""Turn on the relay."""
|
||||||
self._state = True
|
self._state = True
|
||||||
self._last_action = time.time()
|
self._last_action = time.time()
|
||||||
@ -132,7 +132,7 @@ class OmniLogicRelayControl(OmniLogicSwitch):
|
|||||||
1,
|
1,
|
||||||
)
|
)
|
||||||
|
|
||||||
async def async_turn_off(self, **kwargs):
|
async def async_turn_off(self, **kwargs: Any) -> None:
|
||||||
"""Turn off the relay."""
|
"""Turn off the relay."""
|
||||||
self._state = False
|
self._state = False
|
||||||
self._last_action = time.time()
|
self._last_action = time.time()
|
||||||
@ -178,7 +178,7 @@ class OmniLogicPumpControl(OmniLogicSwitch):
|
|||||||
|
|
||||||
self._last_speed = None
|
self._last_speed = None
|
||||||
|
|
||||||
async def async_turn_on(self, **kwargs):
|
async def async_turn_on(self, **kwargs: Any) -> None:
|
||||||
"""Turn on the pump."""
|
"""Turn on the pump."""
|
||||||
self._state = True
|
self._state = True
|
||||||
self._last_action = time.time()
|
self._last_action = time.time()
|
||||||
@ -196,7 +196,7 @@ class OmniLogicPumpControl(OmniLogicSwitch):
|
|||||||
on_value,
|
on_value,
|
||||||
)
|
)
|
||||||
|
|
||||||
async def async_turn_off(self, **kwargs):
|
async def async_turn_off(self, **kwargs: Any) -> None:
|
||||||
"""Turn off the pump."""
|
"""Turn off the pump."""
|
||||||
self._state = False
|
self._state = False
|
||||||
self._last_action = time.time()
|
self._last_action = time.time()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user