From d254d963b88cee0e05355eca047d0c6f5ccaac6c Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 14 Dec 2021 18:46:38 +0100 Subject: [PATCH] Use SensorDeviceClass in incomfort (#61800) Co-authored-by: epenet --- homeassistant/components/incomfort/sensor.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/homeassistant/components/incomfort/sensor.py b/homeassistant/components/incomfort/sensor.py index 0ce2372867a..e0c781c3fc5 100644 --- a/homeassistant/components/incomfort/sensor.py +++ b/homeassistant/components/incomfort/sensor.py @@ -6,15 +6,11 @@ from typing import Any from homeassistant.components.sensor import ( DOMAIN as SENSOR_DOMAIN, + SensorDeviceClass, SensorEntity, SensorEntityDescription, ) -from homeassistant.const import ( - DEVICE_CLASS_PRESSURE, - DEVICE_CLASS_TEMPERATURE, - PRESSURE_BAR, - TEMP_CELSIUS, -) +from homeassistant.const import PRESSURE_BAR, TEMP_CELSIUS from homeassistant.util import slugify from . import DOMAIN, IncomfortChild @@ -35,20 +31,20 @@ SENSOR_TYPES: tuple[IncomfortSensorEntityDescription, ...] = ( IncomfortSensorEntityDescription( key="pressure", name=INCOMFORT_PRESSURE, - device_class=DEVICE_CLASS_PRESSURE, + device_class=SensorDeviceClass.PRESSURE, native_unit_of_measurement=PRESSURE_BAR, ), IncomfortSensorEntityDescription( key="heater_temp", name=INCOMFORT_HEATER_TEMP, - device_class=DEVICE_CLASS_TEMPERATURE, + device_class=SensorDeviceClass.TEMPERATURE, native_unit_of_measurement=TEMP_CELSIUS, extra_key="is_pumping", ), IncomfortSensorEntityDescription( key="tap_temp", name=INCOMFORT_TAP_TEMP, - device_class=DEVICE_CLASS_TEMPERATURE, + device_class=SensorDeviceClass.TEMPERATURE, native_unit_of_measurement=TEMP_CELSIUS, extra_key="is_tapping", ),