Collection of changing entity properties to class attributes - 2 (#51345)

This commit is contained in:
Franck Nijhof 2021-06-01 21:43:55 +02:00 committed by GitHub
parent e5dff49440
commit fcdd8b11a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 70 additions and 215 deletions

View file

@ -29,12 +29,9 @@ async def async_setup_entry(
class WithingsHealthBinarySensor(BaseWithingsSensor, BinarySensorEntity):
"""Implementation of a Withings sensor."""
_attr_device_class = DEVICE_CLASS_OCCUPANCY
@property
def is_on(self) -> bool:
"""Return true if the binary sensor is on."""
return self._state_data
@property
def device_class(self) -> str:
"""Provide the device class."""
return DEVICE_CLASS_OCCUPANCY