From 1954539e6534252c146295923782bd16b40bec59 Mon Sep 17 00:00:00 2001 From: Dennis Date: Thu, 17 Aug 2023 11:13:11 +0200 Subject: [PATCH] Add state_class to tomorrowio UV Index (#98541) * Added state_class to UV Index Forgot to add a state_class as other sensors got their state_class from their device class. As there is no UV Index device class I left it out. * Forgotten a comma, whoops * Changed measurement to string. * Changed from "measurement" to SensorStateClass --- homeassistant/components/tomorrowio/sensor.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/homeassistant/components/tomorrowio/sensor.py b/homeassistant/components/tomorrowio/sensor.py index aba5b44f284187..7ccb4f673cde1d 100644 --- a/homeassistant/components/tomorrowio/sensor.py +++ b/homeassistant/components/tomorrowio/sensor.py @@ -18,6 +18,7 @@ SensorDeviceClass, SensorEntity, SensorEntityDescription, + SensorStateClass, ) from homeassistant.config_entries import ConfigEntry from homeassistant.const import ( @@ -295,6 +296,7 @@ def convert_ppb_to_ugm3(molecular_weight: int | float) -> Callable[[float], floa TomorrowioSensorEntityDescription( key=TMRW_ATTR_UV_INDEX, name="UV Index", + state_class=SensorStateClass.MEASUREMENT, icon="mdi:sun-wireless", ), TomorrowioSensorEntityDescription(