From 2da2de2ac83a1ceab9262d042cb5cf803df665fa Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Wed, 15 Dec 2021 20:11:06 +0100 Subject: [PATCH] Use SensorDeviceClass in mhz19 (#61923) --- homeassistant/components/mhz19/sensor.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/mhz19/sensor.py b/homeassistant/components/mhz19/sensor.py index a599a9f7dfb..60608e37cec 100644 --- a/homeassistant/components/mhz19/sensor.py +++ b/homeassistant/components/mhz19/sensor.py @@ -9,6 +9,7 @@ import voluptuous as vol from homeassistant.components.sensor import ( PLATFORM_SCHEMA, + SensorDeviceClass, SensorEntity, SensorEntityDescription, ) @@ -17,8 +18,6 @@ from homeassistant.const import ( CONCENTRATION_PARTS_PER_MILLION, CONF_MONITORED_CONDITIONS, CONF_NAME, - DEVICE_CLASS_CO2, - DEVICE_CLASS_TEMPERATURE, TEMP_CELSIUS, ) import homeassistant.helpers.config_validation as cv @@ -40,13 +39,13 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = ( key=SENSOR_TEMPERATURE, name="Temperature", native_unit_of_measurement=TEMP_CELSIUS, - device_class=DEVICE_CLASS_TEMPERATURE, + device_class=SensorDeviceClass.TEMPERATURE, ), SensorEntityDescription( key=SENSOR_CO2, name="CO2", native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION, - device_class=DEVICE_CLASS_CO2, + device_class=SensorDeviceClass.CO2, ), ) SENSOR_KEYS: list[str] = [desc.key for desc in SENSOR_TYPES]