Use state class enum for DHT ()

This commit is contained in:
yanuino 2021-12-03 18:32:04 +01:00 committed by GitHub
parent 3baa7b679d
commit a80447f096
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,6 +12,7 @@ from homeassistant.components.sensor import (
PLATFORM_SCHEMA,
SensorEntity,
SensorEntityDescription,
SensorStateClass,
)
from homeassistant.const import (
CONF_MONITORED_CONDITIONS,
@ -44,12 +45,14 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
name="Temperature",
native_unit_of_measurement=TEMP_CELSIUS,
device_class=DEVICE_CLASS_TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
),
SensorEntityDescription(
key=SENSOR_HUMIDITY,
name="Humidity",
native_unit_of_measurement=PERCENTAGE,
device_class=DEVICE_CLASS_HUMIDITY,
state_class=SensorStateClass.MEASUREMENT,
),
)