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: