From 8fc69b72428982406aefa987d77b3bbf86d7927e Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 14 Dec 2021 09:56:52 +0100 Subject: [PATCH] Use new SwitchDeviceClass enum in home-plus-control (#61760) Co-authored-by: epenet --- homeassistant/components/home_plus_control/switch.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/home_plus_control/switch.py b/homeassistant/components/home_plus_control/switch.py index 809a246e631..73fd515e65b 100644 --- a/homeassistant/components/home_plus_control/switch.py +++ b/homeassistant/components/home_plus_control/switch.py @@ -1,11 +1,7 @@ """Legrand Home+ Control Switch Entity Module that uses the HomeAssistant DataUpdateCoordinator.""" from functools import partial -from homeassistant.components.switch import ( - DEVICE_CLASS_OUTLET, - DEVICE_CLASS_SWITCH, - SwitchEntity, -) +from homeassistant.components.switch import SwitchDeviceClass, SwitchEntity from homeassistant.core import callback from homeassistant.helpers import dispatcher from homeassistant.helpers.entity import DeviceInfo @@ -97,8 +93,8 @@ class HomeControlSwitchEntity(CoordinatorEntity, SwitchEntity): def device_class(self): """Return the class of this device, from component DEVICE_CLASSES.""" if self.module.device == "plug": - return DEVICE_CLASS_OUTLET - return DEVICE_CLASS_SWITCH + return SwitchDeviceClass.OUTLET + return SwitchDeviceClass.SWITCH @property def available(self) -> bool: