diff --git a/homeassistant/components/ecobee/binary_sensor.py b/homeassistant/components/ecobee/binary_sensor.py index 94c4ade7398..ae0d395d58a 100644 --- a/homeassistant/components/ecobee/binary_sensor.py +++ b/homeassistant/components/ecobee/binary_sensor.py @@ -2,7 +2,7 @@ from __future__ import annotations from homeassistant.components.binary_sensor import ( - DEVICE_CLASS_OCCUPANCY, + BinarySensorDeviceClass, BinarySensorEntity, ) from homeassistant.helpers.entity import DeviceInfo @@ -97,7 +97,7 @@ class EcobeeBinarySensor(BinarySensorEntity): @property def device_class(self): """Return the class of this sensor, from DEVICE_CLASSES.""" - return DEVICE_CLASS_OCCUPANCY + return BinarySensorDeviceClass.OCCUPANCY async def async_update(self): """Get the latest state of the sensor.""" diff --git a/homeassistant/components/ecobee/humidifier.py b/homeassistant/components/ecobee/humidifier.py index b660a75363f..a98b3712dd3 100644 --- a/homeassistant/components/ecobee/humidifier.py +++ b/homeassistant/components/ecobee/humidifier.py @@ -3,11 +3,10 @@ from __future__ import annotations from datetime import timedelta -from homeassistant.components.humidifier import HumidifierEntity +from homeassistant.components.humidifier import HumidifierDeviceClass, HumidifierEntity from homeassistant.components.humidifier.const import ( DEFAULT_MAX_HUMIDITY, DEFAULT_MIN_HUMIDITY, - DEVICE_CLASS_HUMIDIFIER, MODE_AUTO, SUPPORT_MODES, ) @@ -97,7 +96,7 @@ class EcobeeHumidifier(HumidifierEntity): @property def device_class(self): """Return the device class type.""" - return DEVICE_CLASS_HUMIDIFIER + return HumidifierDeviceClass.HUMIDIFIER @property def is_on(self): diff --git a/homeassistant/components/ecobee/sensor.py b/homeassistant/components/ecobee/sensor.py index cfdf861e7bc..690a0110477 100644 --- a/homeassistant/components/ecobee/sensor.py +++ b/homeassistant/components/ecobee/sensor.py @@ -4,16 +4,12 @@ from __future__ import annotations from pyecobee.const import ECOBEE_STATE_CALIBRATING, ECOBEE_STATE_UNKNOWN from homeassistant.components.sensor import ( - STATE_CLASS_MEASUREMENT, + SensorDeviceClass, SensorEntity, SensorEntityDescription, + SensorStateClass, ) -from homeassistant.const import ( - DEVICE_CLASS_HUMIDITY, - DEVICE_CLASS_TEMPERATURE, - PERCENTAGE, - TEMP_FAHRENHEIT, -) +from homeassistant.const import PERCENTAGE, TEMP_FAHRENHEIT from homeassistant.helpers.entity import DeviceInfo from .const import DOMAIN, ECOBEE_MODEL_TO_NAME, MANUFACTURER @@ -23,15 +19,15 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = ( key="temperature", name="Temperature", native_unit_of_measurement=TEMP_FAHRENHEIT, - device_class=DEVICE_CLASS_TEMPERATURE, - state_class=STATE_CLASS_MEASUREMENT, + device_class=SensorDeviceClass.TEMPERATURE, + state_class=SensorStateClass.MEASUREMENT, ), SensorEntityDescription( key="humidity", name="Humidity", native_unit_of_measurement=PERCENTAGE, - device_class=DEVICE_CLASS_HUMIDITY, - state_class=STATE_CLASS_MEASUREMENT, + device_class=SensorDeviceClass.HUMIDITY, + state_class=SensorStateClass.MEASUREMENT, ), )