Skip to content

Commit 7b8ebb0

Browse files
authored
Move DevoloMultiLevelSwitchDeviceEntity in devolo Home Control (home-assistant#147450)
1 parent c270ea4 commit 7b8ebb0

File tree

6 files changed

+25
-31
lines changed

6 files changed

+25
-31
lines changed

homeassistant/components/devolo_home_control/climate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
1919

2020
from . import DevoloHomeControlConfigEntry
21-
from .devolo_multi_level_switch import DevoloMultiLevelSwitchDeviceEntity
21+
from .entity import DevoloMultiLevelSwitchDeviceEntity
2222

2323

2424
async def async_setup_entry(

homeassistant/components/devolo_home_control/cover.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
1414

1515
from . import DevoloHomeControlConfigEntry
16-
from .devolo_multi_level_switch import DevoloMultiLevelSwitchDeviceEntity
16+
from .entity import DevoloMultiLevelSwitchDeviceEntity
1717

1818

1919
async def async_setup_entry(

homeassistant/components/devolo_home_control/devolo_multi_level_switch.py

Lines changed: 0 additions & 27 deletions
This file was deleted.

homeassistant/components/devolo_home_control/entity.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,24 @@ def _generic_message(self, message: tuple) -> None:
9090
self._attr_available = self._device_instance.is_online()
9191
else:
9292
_LOGGER.debug("No valid message received: %s", message)
93+
94+
95+
class DevoloMultiLevelSwitchDeviceEntity(DevoloDeviceEntity):
96+
"""Representation of a multi level switch device within devolo Home Control. Something like a dimmer or a thermostat."""
97+
98+
_attr_name = None
99+
100+
def __init__(
101+
self, homecontrol: HomeControl, device_instance: Zwave, element_uid: str
102+
) -> None:
103+
"""Initialize a multi level switch within devolo Home Control."""
104+
super().__init__(
105+
homecontrol=homecontrol,
106+
device_instance=device_instance,
107+
element_uid=element_uid,
108+
)
109+
self._multi_level_switch_property = device_instance.multi_level_switch_property[
110+
element_uid
111+
]
112+
113+
self._value = self._multi_level_switch_property.value

homeassistant/components/devolo_home_control/light.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
1313

1414
from . import DevoloHomeControlConfigEntry
15-
from .devolo_multi_level_switch import DevoloMultiLevelSwitchDeviceEntity
15+
from .entity import DevoloMultiLevelSwitchDeviceEntity
1616

1717

1818
async def async_setup_entry(

homeassistant/components/devolo_home_control/siren.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
1111

1212
from . import DevoloHomeControlConfigEntry
13-
from .devolo_multi_level_switch import DevoloMultiLevelSwitchDeviceEntity
13+
from .entity import DevoloMultiLevelSwitchDeviceEntity
1414

1515

1616
async def async_setup_entry(

0 commit comments

Comments
 (0)