diff --git a/homeassistant/components/switcher_kis/sensor.py b/homeassistant/components/switcher_kis/sensor.py index d694bfee380..6b6bf1bec4a 100644 --- a/homeassistant/components/switcher_kis/sensor.py +++ b/homeassistant/components/switcher_kis/sensor.py @@ -6,10 +6,9 @@ from dataclasses import dataclass from aioswitcher.device import DeviceCategory from homeassistant.components.sensor import ( - DEVICE_CLASS_CURRENT, - DEVICE_CLASS_POWER, - STATE_CLASS_MEASUREMENT, + SensorDeviceClass, SensorEntity, + SensorStateClass, ) from homeassistant.config_entries import ConfigEntry from homeassistant.const import ELECTRIC_CURRENT_AMPERE, POWER_WATT @@ -40,14 +39,14 @@ POWER_SENSORS = { "power_consumption": AttributeDescription( name="Power Consumption", unit=POWER_WATT, - device_class=DEVICE_CLASS_POWER, - state_class=STATE_CLASS_MEASUREMENT, + device_class=SensorDeviceClass.POWER, + state_class=SensorStateClass.MEASUREMENT, ), "electric_current": AttributeDescription( name="Electric Current", unit=ELECTRIC_CURRENT_AMPERE, - device_class=DEVICE_CLASS_CURRENT, - state_class=STATE_CLASS_MEASUREMENT, + device_class=SensorDeviceClass.CURRENT, + state_class=SensorStateClass.MEASUREMENT, ), } diff --git a/homeassistant/components/switcher_kis/switch.py b/homeassistant/components/switcher_kis/switch.py index 620a742f4e3..6df841b1e4e 100644 --- a/homeassistant/components/switcher_kis/switch.py +++ b/homeassistant/components/switcher_kis/switch.py @@ -10,11 +10,7 @@ from aioswitcher.api import Command, SwitcherApi, SwitcherBaseResponse from aioswitcher.device import DeviceCategory, DeviceState import voluptuous as vol -from homeassistant.components.switch import ( - DEVICE_CLASS_OUTLET, - DEVICE_CLASS_SWITCH, - SwitchEntity, -) +from homeassistant.components.switch import SwitchDeviceClass, SwitchEntity from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant, callback from homeassistant.helpers import ( @@ -169,13 +165,13 @@ class SwitcherBaseSwitchEntity(CoordinatorEntity, SwitchEntity): class SwitcherPowerPlugSwitchEntity(SwitcherBaseSwitchEntity): """Representation of a Switcher power plug switch entity.""" - _attr_device_class = DEVICE_CLASS_OUTLET + _attr_device_class = SwitchDeviceClass.OUTLET class SwitcherWaterHeaterSwitchEntity(SwitcherBaseSwitchEntity): """Representation of a Switcher water heater switch entity.""" - _attr_device_class = DEVICE_CLASS_SWITCH + _attr_device_class = SwitchDeviceClass.SWITCH async def async_set_auto_off_service(self, auto_off: timedelta) -> None: """Use for handling setting device auto-off service calls."""