Skip to content

Commit

Permalink
Add state_class to tomorrowio UV Index (home-assistant#98541)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
dirrgang authored Aug 17, 2023
1 parent 8b4937f commit 1954539
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions homeassistant/components/tomorrowio/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
SensorDeviceClass,
SensorEntity,
SensorEntityDescription,
SensorStateClass,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 1954539

Please sign in to comment.