Use SensorDeviceClass in incomfort (#61800)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2021-12-14 18:46:38 +01:00 committed by GitHub
parent 93c05b627f
commit d254d963b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,15 +6,11 @@ from typing import Any
from homeassistant.components.sensor import ( from homeassistant.components.sensor import (
DOMAIN as SENSOR_DOMAIN, DOMAIN as SENSOR_DOMAIN,
SensorDeviceClass,
SensorEntity, SensorEntity,
SensorEntityDescription, SensorEntityDescription,
) )
from homeassistant.const import ( from homeassistant.const import PRESSURE_BAR, TEMP_CELSIUS
DEVICE_CLASS_PRESSURE,
DEVICE_CLASS_TEMPERATURE,
PRESSURE_BAR,
TEMP_CELSIUS,
)
from homeassistant.util import slugify from homeassistant.util import slugify
from . import DOMAIN, IncomfortChild from . import DOMAIN, IncomfortChild
@ -35,20 +31,20 @@ SENSOR_TYPES: tuple[IncomfortSensorEntityDescription, ...] = (
IncomfortSensorEntityDescription( IncomfortSensorEntityDescription(
key="pressure", key="pressure",
name=INCOMFORT_PRESSURE, name=INCOMFORT_PRESSURE,
device_class=DEVICE_CLASS_PRESSURE, device_class=SensorDeviceClass.PRESSURE,
native_unit_of_measurement=PRESSURE_BAR, native_unit_of_measurement=PRESSURE_BAR,
), ),
IncomfortSensorEntityDescription( IncomfortSensorEntityDescription(
key="heater_temp", key="heater_temp",
name=INCOMFORT_HEATER_TEMP, name=INCOMFORT_HEATER_TEMP,
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
native_unit_of_measurement=TEMP_CELSIUS, native_unit_of_measurement=TEMP_CELSIUS,
extra_key="is_pumping", extra_key="is_pumping",
), ),
IncomfortSensorEntityDescription( IncomfortSensorEntityDescription(
key="tap_temp", key="tap_temp",
name=INCOMFORT_TAP_TEMP, name=INCOMFORT_TAP_TEMP,
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
native_unit_of_measurement=TEMP_CELSIUS, native_unit_of_measurement=TEMP_CELSIUS,
extra_key="is_tapping", extra_key="is_tapping",
), ),