Add state class to mobile_app restore entity (#115798)

add state class
This commit is contained in:
Luca Angemi 2024-04-18 14:06:51 +02:00 committed by GitHub
parent 28da10ad0d
commit 844ff30a60
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,6 +17,7 @@ from .const import (
ATTR_SENSOR_ENTITY_CATEGORY,
ATTR_SENSOR_ICON,
ATTR_SENSOR_STATE,
ATTR_SENSOR_STATE_CLASS,
SIGNAL_SENSOR_UPDATE,
)
from .helpers import device_info
@ -44,6 +45,7 @@ class MobileAppEntity(RestoreEntity):
"""Update the entity from the config."""
config = self._config
self._attr_device_class = config.get(ATTR_SENSOR_DEVICE_CLASS)
self._attr_state_class = config.get(ATTR_SENSOR_STATE_CLASS)
self._attr_extra_state_attributes = config[ATTR_SENSOR_ATTRIBUTES]
self._attr_icon = config[ATTR_SENSOR_ICON]
self._attr_entity_category = config.get(ATTR_SENSOR_ENTITY_CATEGORY)