diff --git a/homeassistant/components/devolo_home_control/climate.py b/homeassistant/components/devolo_home_control/climate.py index 3fdfa60870a..95db596c3ef 100644 --- a/homeassistant/components/devolo_home_control/climate.py +++ b/homeassistant/components/devolo_home_control/climate.py @@ -18,7 +18,7 @@ from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback from . import DevoloHomeControlConfigEntry -from .devolo_multi_level_switch import DevoloMultiLevelSwitchDeviceEntity +from .entity import DevoloMultiLevelSwitchDeviceEntity async def async_setup_entry( diff --git a/homeassistant/components/devolo_home_control/cover.py b/homeassistant/components/devolo_home_control/cover.py index f23244f1b50..bafef2b02c9 100644 --- a/homeassistant/components/devolo_home_control/cover.py +++ b/homeassistant/components/devolo_home_control/cover.py @@ -13,7 +13,7 @@ from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback from . import DevoloHomeControlConfigEntry -from .devolo_multi_level_switch import DevoloMultiLevelSwitchDeviceEntity +from .entity import DevoloMultiLevelSwitchDeviceEntity async def async_setup_entry( diff --git a/homeassistant/components/devolo_home_control/devolo_multi_level_switch.py b/homeassistant/components/devolo_home_control/devolo_multi_level_switch.py deleted file mode 100644 index 3e2d551d1f8..00000000000 --- a/homeassistant/components/devolo_home_control/devolo_multi_level_switch.py +++ /dev/null @@ -1,27 +0,0 @@ -"""Base class for multi level switches in devolo Home Control.""" - -from devolo_home_control_api.devices.zwave import Zwave -from devolo_home_control_api.homecontrol import HomeControl - -from .entity import DevoloDeviceEntity - - -class DevoloMultiLevelSwitchDeviceEntity(DevoloDeviceEntity): - """Representation of a multi level switch device within devolo Home Control. Something like a dimmer or a thermostat.""" - - _attr_name = None - - def __init__( - self, homecontrol: HomeControl, device_instance: Zwave, element_uid: str - ) -> None: - """Initialize a multi level switch within devolo Home Control.""" - super().__init__( - homecontrol=homecontrol, - device_instance=device_instance, - element_uid=element_uid, - ) - self._multi_level_switch_property = device_instance.multi_level_switch_property[ - element_uid - ] - - self._value = self._multi_level_switch_property.value diff --git a/homeassistant/components/devolo_home_control/entity.py b/homeassistant/components/devolo_home_control/entity.py index 26b450a2cf2..dbe53c21412 100644 --- a/homeassistant/components/devolo_home_control/entity.py +++ b/homeassistant/components/devolo_home_control/entity.py @@ -90,3 +90,24 @@ class DevoloDeviceEntity(Entity): self._attr_available = self._device_instance.is_online() else: _LOGGER.debug("No valid message received: %s", message) + + +class DevoloMultiLevelSwitchDeviceEntity(DevoloDeviceEntity): + """Representation of a multi level switch device within devolo Home Control. Something like a dimmer or a thermostat.""" + + _attr_name = None + + def __init__( + self, homecontrol: HomeControl, device_instance: Zwave, element_uid: str + ) -> None: + """Initialize a multi level switch within devolo Home Control.""" + super().__init__( + homecontrol=homecontrol, + device_instance=device_instance, + element_uid=element_uid, + ) + self._multi_level_switch_property = device_instance.multi_level_switch_property[ + element_uid + ] + + self._value = self._multi_level_switch_property.value diff --git a/homeassistant/components/devolo_home_control/light.py b/homeassistant/components/devolo_home_control/light.py index 8a88081ed05..907a46ec27b 100644 --- a/homeassistant/components/devolo_home_control/light.py +++ b/homeassistant/components/devolo_home_control/light.py @@ -12,7 +12,7 @@ from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback from . import DevoloHomeControlConfigEntry -from .devolo_multi_level_switch import DevoloMultiLevelSwitchDeviceEntity +from .entity import DevoloMultiLevelSwitchDeviceEntity async def async_setup_entry( diff --git a/homeassistant/components/devolo_home_control/siren.py b/homeassistant/components/devolo_home_control/siren.py index 5e4df944b3c..e3f91ca4d7d 100644 --- a/homeassistant/components/devolo_home_control/siren.py +++ b/homeassistant/components/devolo_home_control/siren.py @@ -10,7 +10,7 @@ from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback from . import DevoloHomeControlConfigEntry -from .devolo_multi_level_switch import DevoloMultiLevelSwitchDeviceEntity +from .entity import DevoloMultiLevelSwitchDeviceEntity async def async_setup_entry(