From a459cf8ca4b094783fbd1a89555cb7f414dd06fd Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Mon, 24 Jan 2022 11:31:50 +0100 Subject: [PATCH] Use shorthand attributes in shelly covers (#64829) Co-authored-by: epenet --- homeassistant/components/shelly/cover.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/shelly/cover.py b/homeassistant/components/shelly/cover.py index 78aa7606aac..f9bd1b7ce85 100644 --- a/homeassistant/components/shelly/cover.py +++ b/homeassistant/components/shelly/cover.py @@ -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")