Collection of changing entity properties to class attributes - 2 (#51345)
This commit is contained in:
parent
e5dff49440
commit
fcdd8b11a6
24 changed files with 70 additions and 215 deletions
|
@ -37,6 +37,8 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
|||
class SmartHabCover(CoverEntity):
|
||||
"""Representation a cover."""
|
||||
|
||||
_attr_device_class = DEVICE_CLASS_WINDOW
|
||||
|
||||
def __init__(self, cover):
|
||||
"""Initialize a SmartHabCover."""
|
||||
self._cover = cover
|
||||
|
@ -69,11 +71,6 @@ class SmartHabCover(CoverEntity):
|
|||
"""Return if the cover is closed or not."""
|
||||
return self._cover.state == 0
|
||||
|
||||
@property
|
||||
def device_class(self) -> str:
|
||||
"""Return the class of this device, from component DEVICE_CLASSES."""
|
||||
return DEVICE_CLASS_WINDOW
|
||||
|
||||
async def async_open_cover(self, **kwargs):
|
||||
"""Open the cover."""
|
||||
await self._cover.async_open()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue