From 844ff30a606866eb28093ae6a0da901824f3729f Mon Sep 17 00:00:00 2001 From: Luca Angemi Date: Thu, 18 Apr 2024 14:06:51 +0200 Subject: [PATCH] Add state class to mobile_app restore entity (#115798) add state class --- homeassistant/components/mobile_app/entity.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/homeassistant/components/mobile_app/entity.py b/homeassistant/components/mobile_app/entity.py index 1cac62ce964..f1f7b592621 100644 --- a/homeassistant/components/mobile_app/entity.py +++ b/homeassistant/components/mobile_app/entity.py @@ -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)