mirror of
https://github.com/home-assistant/core.git
synced 2025-08-06 14:15:12 +02:00
Adjust type hints in rflink cover
This commit is contained in:
@@ -315,7 +315,6 @@ class RflinkDevice(Entity):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
platform = None
|
platform = None
|
||||||
_state = None
|
|
||||||
_available = True
|
_available = True
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
@@ -345,6 +344,7 @@ class RflinkDevice(Entity):
|
|||||||
self._nogroup_aliases = nogroup_aliases
|
self._nogroup_aliases = nogroup_aliases
|
||||||
self._should_fire_event = fire_event
|
self._should_fire_event = fire_event
|
||||||
self._signal_repetitions = signal_repetitions
|
self._signal_repetitions = signal_repetitions
|
||||||
|
self._state = None
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def handle_event_callback(self, event):
|
def handle_event_callback(self, event):
|
||||||
|
@@ -125,7 +125,9 @@ async def async_setup_platform(
|
|||||||
class RflinkCover(RflinkCommand, CoverEntity, RestoreEntity):
|
class RflinkCover(RflinkCommand, CoverEntity, RestoreEntity):
|
||||||
"""Rflink entity which can switch on/stop/off (eg: cover)."""
|
"""Rflink entity which can switch on/stop/off (eg: cover)."""
|
||||||
|
|
||||||
async def async_added_to_hass(self):
|
_state: bool | None
|
||||||
|
|
||||||
|
async def async_added_to_hass(self) -> None:
|
||||||
"""Restore RFLink cover state (OPEN/CLOSE)."""
|
"""Restore RFLink cover state (OPEN/CLOSE)."""
|
||||||
await super().async_added_to_hass()
|
await super().async_added_to_hass()
|
||||||
if (old_state := await self.async_get_last_state()) is not None:
|
if (old_state := await self.async_get_last_state()) is not None:
|
||||||
@@ -142,17 +144,17 @@ class RflinkCover(RflinkCommand, CoverEntity, RestoreEntity):
|
|||||||
self._state = False
|
self._state = False
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def should_poll(self):
|
def should_poll(self) -> bool:
|
||||||
"""No polling available in RFlink cover."""
|
"""No polling available in RFlink cover."""
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_closed(self):
|
def is_closed(self) -> bool | None:
|
||||||
"""Return if the cover is closed."""
|
"""Return if the cover is closed."""
|
||||||
return not self._state
|
return not self._state
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def assumed_state(self):
|
def assumed_state(self) -> bool:
|
||||||
"""Return True because covers can be stopped midway."""
|
"""Return True because covers can be stopped midway."""
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user