Use shorthand attributes in Ring (#99829)
This commit is contained in:
parent
a00cbe2677
commit
02e077daab
5 changed files with 19 additions and 54 deletions
|
@ -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."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue