Use shorthand attributes in Ring (#99829)

This commit is contained in:
Joost Lekkerkerker 2023-09-07 19:51:35 +02:00 committed by GitHub
parent a00cbe2677
commit 02e077daab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 54 deletions

View file

@ -68,6 +68,9 @@ class RingSensor(RingEntityMixin, SensorEntity):
class HealthDataRingSensor(RingSensor):
"""Ring sensor that relies on health data."""
# These sensors are data hungry and not useful. Disable by default.
_attr_entity_registry_enabled_default = False
async def async_added_to_hass(self) -> None:
"""Register callbacks."""
await super().async_added_to_hass()
@ -89,12 +92,6 @@ class HealthDataRingSensor(RingSensor):
"""Call update method."""
self.async_write_ha_state()
@property
def entity_registry_enabled_default(self) -> bool:
"""Return if the entity should be enabled when first added to the entity registry."""
# These sensors are data hungry and not useful. Disable by default.
return False
@property
def native_value(self):
"""Return the state of the sensor."""