Mobile app to notify when sensor is disabled (#71561)

* Mobile app to notify when sensor is disabled

* Add entity status to get_config

* Allow overriding enabled/disabled
This commit is contained in:
Paulus Schoutsen 2022-05-17 09:05:49 -07:00 committed by GitHub
parent e4573273dc
commit 0b09376360
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 162 additions and 13 deletions

View file

@ -9,8 +9,8 @@ from homeassistant.helpers.restore_state import RestoreEntity
from .const import (
ATTR_SENSOR_ATTRIBUTES,
ATTR_SENSOR_DEFAULT_DISABLED,
ATTR_SENSOR_DEVICE_CLASS,
ATTR_SENSOR_DISABLED,
ATTR_SENSOR_ENTITY_CATEGORY,
ATTR_SENSOR_ICON,
ATTR_SENSOR_STATE,
@ -64,7 +64,7 @@ class MobileAppEntity(RestoreEntity):
@property
def entity_registry_enabled_default(self) -> bool:
"""Return if entity should be enabled by default."""
return not self._config.get(ATTR_SENSOR_DEFAULT_DISABLED)
return not self._config.get(ATTR_SENSOR_DISABLED)
@property
def device_class(self):