Set measurement entity_class for darksky temp & humidity (#59512)

This commit is contained in:
jjlawren 2021-11-14 13:41:23 -06:00 committed by GitHub
parent 85aeee7cc7
commit 305d25b510
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,6 +13,7 @@ import voluptuous as vol
from homeassistant.components.sensor import (
DEVICE_CLASS_TEMPERATURE,
PLATFORM_SCHEMA,
STATE_CLASS_MEASUREMENT,
SensorEntity,
SensorEntityDescription,
)
@ -181,6 +182,7 @@ SENSOR_TYPES: dict[str, DarkskySensorEntityDescription] = {
key="temperature",
name="Temperature",
device_class=DEVICE_CLASS_TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT,
si_unit=TEMP_CELSIUS,
us_unit=TEMP_FAHRENHEIT,
ca_unit=TEMP_CELSIUS,
@ -192,6 +194,7 @@ SENSOR_TYPES: dict[str, DarkskySensorEntityDescription] = {
key="apparent_temperature",
name="Apparent Temperature",
device_class=DEVICE_CLASS_TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT,
si_unit=TEMP_CELSIUS,
us_unit=TEMP_FAHRENHEIT,
ca_unit=TEMP_CELSIUS,
@ -203,6 +206,7 @@ SENSOR_TYPES: dict[str, DarkskySensorEntityDescription] = {
key="dew_point",
name="Dew Point",
device_class=DEVICE_CLASS_TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT,
si_unit=TEMP_CELSIUS,
us_unit=TEMP_FAHRENHEIT,
ca_unit=TEMP_CELSIUS,
@ -258,6 +262,7 @@ SENSOR_TYPES: dict[str, DarkskySensorEntityDescription] = {
key="humidity",
name="Humidity",
device_class=DEVICE_CLASS_HUMIDITY,
state_class=STATE_CLASS_MEASUREMENT,
si_unit=PERCENTAGE,
us_unit=PERCENTAGE,
ca_unit=PERCENTAGE,