Collection of changing entity properties to class attributes (#51248)

* Collection of changing entity properties to class attributes

* Apply suggestions from code review

Co-authored-by: Erik Montnemery <erik@montnemery.com>

Co-authored-by: Erik Montnemery <erik@montnemery.com>
This commit is contained in:
Franck Nijhof 2021-05-31 10:50:11 +02:00 committed by GitHub
parent 5acc3a1083
commit 258b388f41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 106 additions and 305 deletions

View file

@ -112,6 +112,8 @@ class HMCover(HMDevice, CoverEntity):
class HMGarage(HMCover):
"""Represents a Homematic Garage cover. Homematic garage covers do not support position attributes."""
_attr_device_class = DEVICE_CLASS_GARAGE
@property
def current_cover_position(self):
"""
@ -127,11 +129,6 @@ class HMGarage(HMCover):
"""Return whether the cover is closed."""
return self._hmdevice.is_closed(self._hm_get_state())
@property
def device_class(self):
"""Return the device class."""
return DEVICE_CLASS_GARAGE
def _init_data_struct(self):
"""Generate a data dictionary (self._data) from metadata."""
self._state = "DOOR_STATE"