Use new DeviceClass enum in geniushub (#61608)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2021-12-13 17:39:38 +01:00 committed by GitHub
parent 3098778001
commit 3cfc349e99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -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:

View file

@ -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: