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

@ -127,6 +127,8 @@ class DeconzTampering(DeconzDevice, BinarySensorEntity):
TYPE = DOMAIN
_attr_device_class = DEVICE_CLASS_PROBLEM
@property
def unique_id(self) -> str:
"""Return a unique identifier for this device."""
@ -148,8 +150,3 @@ class DeconzTampering(DeconzDevice, BinarySensorEntity):
def name(self) -> str:
"""Return the name of the sensor."""
return f"{self._device.name} Tampered"
@property
def device_class(self) -> str:
"""Return the class of the sensor."""
return DEVICE_CLASS_PROBLEM