From c49d59bf54a2d606918aa5fc535f071f13b17cfc Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 16 Dec 2021 02:15:54 +0100 Subject: [PATCH] Use new enums in nexia (#61952) --- homeassistant/components/nexia/sensor.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/homeassistant/components/nexia/sensor.py b/homeassistant/components/nexia/sensor.py index 15479df310b..5ad5025fea3 100644 --- a/homeassistant/components/nexia/sensor.py +++ b/homeassistant/components/nexia/sensor.py @@ -2,14 +2,8 @@ from nexia.const import UNIT_CELSIUS -from homeassistant.components.sensor import SensorEntity -from homeassistant.const import ( - DEVICE_CLASS_HUMIDITY, - DEVICE_CLASS_TEMPERATURE, - PERCENTAGE, - TEMP_CELSIUS, - TEMP_FAHRENHEIT, -) +from homeassistant.components.sensor import SensorDeviceClass, SensorEntity +from homeassistant.const import PERCENTAGE, TEMP_CELSIUS, TEMP_FAHRENHEIT from .const import DOMAIN from .coordinator import NexiaDataUpdateCoordinator @@ -86,7 +80,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities): thermostat, "get_outdoor_temperature", "Outdoor Temperature", - DEVICE_CLASS_TEMPERATURE, + SensorDeviceClass.TEMPERATURE, unit, ) ) @@ -98,7 +92,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities): thermostat, "get_relative_humidity", "Relative Humidity", - DEVICE_CLASS_HUMIDITY, + SensorDeviceClass.HUMIDITY, PERCENTAGE, percent_conv, ) @@ -119,7 +113,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities): zone, "get_temperature", "Temperature", - DEVICE_CLASS_TEMPERATURE, + SensorDeviceClass.TEMPERATURE, unit, None, )