mirror of
https://github.com/home-assistant/core.git
synced 2025-07-12 15:57:06 +00:00
Use new SwitchDeviceClass enum in home-plus-control (#61760)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
de45144750
commit
8fc69b7242
@ -1,11 +1,7 @@
|
|||||||
"""Legrand Home+ Control Switch Entity Module that uses the HomeAssistant DataUpdateCoordinator."""
|
"""Legrand Home+ Control Switch Entity Module that uses the HomeAssistant DataUpdateCoordinator."""
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
|
||||||
from homeassistant.components.switch import (
|
from homeassistant.components.switch import SwitchDeviceClass, SwitchEntity
|
||||||
DEVICE_CLASS_OUTLET,
|
|
||||||
DEVICE_CLASS_SWITCH,
|
|
||||||
SwitchEntity,
|
|
||||||
)
|
|
||||||
from homeassistant.core import callback
|
from homeassistant.core import callback
|
||||||
from homeassistant.helpers import dispatcher
|
from homeassistant.helpers import dispatcher
|
||||||
from homeassistant.helpers.entity import DeviceInfo
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
@ -97,8 +93,8 @@ class HomeControlSwitchEntity(CoordinatorEntity, SwitchEntity):
|
|||||||
def device_class(self):
|
def device_class(self):
|
||||||
"""Return the class of this device, from component DEVICE_CLASSES."""
|
"""Return the class of this device, from component DEVICE_CLASSES."""
|
||||||
if self.module.device == "plug":
|
if self.module.device == "plug":
|
||||||
return DEVICE_CLASS_OUTLET
|
return SwitchDeviceClass.OUTLET
|
||||||
return DEVICE_CLASS_SWITCH
|
return SwitchDeviceClass.SWITCH
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def available(self) -> bool:
|
def available(self) -> bool:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user