Use shorthand attributes in shelly covers (#64829)
Co-authored-by: epenet <epenet@users.noreply.github.com>pull/64833/head
parent
b8237e5ec9
commit
a459cf8ca4
|
@ -47,9 +47,9 @@ class ShellyCover(ShellyBlockEntity, CoverEntity):
|
|||
"""Initialize light."""
|
||||
super().__init__(wrapper, block)
|
||||
self.control_result: dict[str, Any] | None = None
|
||||
self._supported_features: int = SUPPORT_OPEN | SUPPORT_CLOSE | SUPPORT_STOP
|
||||
self._attr_supported_features: int = SUPPORT_OPEN | SUPPORT_CLOSE | SUPPORT_STOP
|
||||
if self.wrapper.device.settings["rollers"][0]["positioning"]:
|
||||
self._supported_features |= SUPPORT_SET_POSITION
|
||||
self._attr_supported_features |= SUPPORT_SET_POSITION
|
||||
|
||||
@property
|
||||
def is_closed(self) -> bool:
|
||||
|
@ -83,11 +83,6 @@ class ShellyCover(ShellyBlockEntity, CoverEntity):
|
|||
|
||||
return self.block.roller == "open"
|
||||
|
||||
@property
|
||||
def supported_features(self) -> int:
|
||||
"""Flag supported features."""
|
||||
return self._supported_features
|
||||
|
||||
async def async_close_cover(self, **kwargs: Any) -> None:
|
||||
"""Close cover."""
|
||||
self.control_result = await self.set_state(go="close")
|
||||
|
|
Loading…
Reference in New Issue