From 2c26eae9b2c98bffa3f983fc1fa48c5c0e910d01 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 14 Dec 2021 18:32:17 +0100 Subject: [PATCH] Use new DeviceClass enums in iaqualink (#61805) Co-authored-by: epenet --- homeassistant/components/iaqualink/binary_sensor.py | 4 ++-- homeassistant/components/iaqualink/sensor.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/iaqualink/binary_sensor.py b/homeassistant/components/iaqualink/binary_sensor.py index 26d446541e6..4694c5af86f 100644 --- a/homeassistant/components/iaqualink/binary_sensor.py +++ b/homeassistant/components/iaqualink/binary_sensor.py @@ -1,7 +1,7 @@ """Support for Aqualink temperature sensors.""" from homeassistant.components.binary_sensor import ( - DEVICE_CLASS_COLD, DOMAIN, + BinarySensorDeviceClass, BinarySensorEntity, ) from homeassistant.config_entries import ConfigEntry @@ -40,5 +40,5 @@ class HassAqualinkBinarySensor(AqualinkEntity, BinarySensorEntity): def device_class(self) -> str: """Return the class of the binary sensor.""" if self.name == "Freeze Protection": - return DEVICE_CLASS_COLD + return BinarySensorDeviceClass.COLD return None diff --git a/homeassistant/components/iaqualink/sensor.py b/homeassistant/components/iaqualink/sensor.py index 61e4560c3be..7724fbf28ee 100644 --- a/homeassistant/components/iaqualink/sensor.py +++ b/homeassistant/components/iaqualink/sensor.py @@ -1,9 +1,9 @@ """Support for Aqualink temperature sensors.""" from __future__ import annotations -from homeassistant.components.sensor import DOMAIN, SensorEntity +from homeassistant.components.sensor import DOMAIN, SensorDeviceClass, SensorEntity from homeassistant.config_entries import ConfigEntry -from homeassistant.const import DEVICE_CLASS_TEMPERATURE, TEMP_CELSIUS, TEMP_FAHRENHEIT +from homeassistant.const import TEMP_CELSIUS, TEMP_FAHRENHEIT from homeassistant.core import HomeAssistant from . import AqualinkEntity @@ -55,5 +55,5 @@ class HassAqualinkSensor(AqualinkEntity, SensorEntity): def device_class(self) -> str | None: """Return the class of the sensor.""" if self.dev.name.endswith("_temp"): - return DEVICE_CLASS_TEMPERATURE + return SensorDeviceClass.TEMPERATURE return None