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:
parent
5acc3a1083
commit
258b388f41
32 changed files with 106 additions and 305 deletions
|
@ -29,17 +29,14 @@ class LutronOccupancySensor(LutronDevice, BinarySensorEntity):
|
|||
reported as a single occupancy group.
|
||||
"""
|
||||
|
||||
_attr_device_class = DEVICE_CLASS_OCCUPANCY
|
||||
|
||||
@property
|
||||
def is_on(self):
|
||||
"""Return true if the binary sensor is on."""
|
||||
# Error cases will end up treated as unoccupied.
|
||||
return self._lutron_device.state == OccupancyGroup.State.OCCUPIED
|
||||
|
||||
@property
|
||||
def device_class(self):
|
||||
"""Return that this is an occupancy sensor."""
|
||||
return DEVICE_CLASS_OCCUPANCY
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Return the name of the device."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue