From 3cfc349e998b0518d856f7de55140e2d5829208d Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Mon, 13 Dec 2021 17:39:38 +0100 Subject: [PATCH] Use new DeviceClass enum in geniushub (#61608) Co-authored-by: epenet --- homeassistant/components/geniushub/sensor.py | 6 +++--- homeassistant/components/geniushub/switch.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/geniushub/sensor.py b/homeassistant/components/geniushub/sensor.py index 362e729f57a..c179fe7a588 100644 --- a/homeassistant/components/geniushub/sensor.py +++ b/homeassistant/components/geniushub/sensor.py @@ -4,8 +4,8 @@ from __future__ import annotations from datetime import timedelta from typing import Any -from homeassistant.components.sensor import SensorEntity -from homeassistant.const import DEVICE_CLASS_BATTERY, PERCENTAGE +from homeassistant.components.sensor import SensorDeviceClass, SensorEntity +from homeassistant.const import PERCENTAGE from homeassistant.core import HomeAssistant from homeassistant.helpers.typing import ConfigType import homeassistant.util.dt as dt_util @@ -76,7 +76,7 @@ class GeniusBattery(GeniusDevice, SensorEntity): @property def device_class(self) -> str: """Return the device class of the sensor.""" - return DEVICE_CLASS_BATTERY + return SensorDeviceClass.BATTERY @property def native_unit_of_measurement(self) -> str: diff --git a/homeassistant/components/geniushub/switch.py b/homeassistant/components/geniushub/switch.py index 2666f3d365b..aebf64d21bd 100644 --- a/homeassistant/components/geniushub/switch.py +++ b/homeassistant/components/geniushub/switch.py @@ -3,7 +3,7 @@ from datetime import timedelta import voluptuous as vol -from homeassistant.components.switch import DEVICE_CLASS_OUTLET, SwitchEntity +from homeassistant.components.switch import SwitchDeviceClass, SwitchEntity from homeassistant.core import HomeAssistant from homeassistant.helpers import config_validation as cv, entity_platform from homeassistant.helpers.typing import ConfigType @@ -55,7 +55,7 @@ class GeniusSwitch(GeniusZone, SwitchEntity): @property def device_class(self): """Return the class of this device, from component DEVICE_CLASSES.""" - return DEVICE_CLASS_OUTLET + return SwitchDeviceClass.OUTLET @property def is_on(self) -> bool: