Add state_class to Ecobee sensors (#55996)

pull/56095/head
Brent Petit 2021-09-11 00:00:24 -05:00 committed by GitHub
parent b11db0b1d7
commit 97f28878bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -3,7 +3,11 @@ from __future__ import annotations
from pyecobee.const import ECOBEE_STATE_CALIBRATING, ECOBEE_STATE_UNKNOWN
from homeassistant.components.sensor import SensorEntity, SensorEntityDescription
from homeassistant.components.sensor import (
STATE_CLASS_MEASUREMENT,
SensorEntity,
SensorEntityDescription,
)
from homeassistant.const import (
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_TEMPERATURE,
@ -19,12 +23,14 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
name="Temperature",
native_unit_of_measurement=TEMP_FAHRENHEIT,
device_class=DEVICE_CLASS_TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT,
),
SensorEntityDescription(
key="humidity",
name="Humidity",
native_unit_of_measurement=PERCENTAGE,
device_class=DEVICE_CLASS_HUMIDITY,
state_class=STATE_CLASS_MEASUREMENT,
),
)