mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
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
This commit is contained in:
parent
8b4937f627
commit
1954539e65
@ -18,6 +18,7 @@ from homeassistant.components.sensor import (
|
|||||||
SensorDeviceClass,
|
SensorDeviceClass,
|
||||||
SensorEntity,
|
SensorEntity,
|
||||||
SensorEntityDescription,
|
SensorEntityDescription,
|
||||||
|
SensorStateClass,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
@ -295,6 +296,7 @@ SENSOR_TYPES = (
|
|||||||
TomorrowioSensorEntityDescription(
|
TomorrowioSensorEntityDescription(
|
||||||
key=TMRW_ATTR_UV_INDEX,
|
key=TMRW_ATTR_UV_INDEX,
|
||||||
name="UV Index",
|
name="UV Index",
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
icon="mdi:sun-wireless",
|
icon="mdi:sun-wireless",
|
||||||
),
|
),
|
||||||
TomorrowioSensorEntityDescription(
|
TomorrowioSensorEntityDescription(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user