Add cover tests for devolo_home_control (#72428)

This commit is contained in:
Guido Schmitz 2022-06-29 15:46:32 +02:00 committed by GitHub
parent 8905e6f726
commit 8dd5f25da9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 128 additions and 2 deletions

View file

@ -51,7 +51,6 @@ class MultiLevelSwitchPropertyMock(MultiLevelSwitchProperty):
self.element_uid = "Test"
self.min = 4
self.max = 24
self.switch_type = "temperature"
self._value = 20
self._logger = MagicMock()
@ -120,9 +119,21 @@ class ClimateMock(DeviceMock):
super().__init__()
self.device_model_uid = "devolo.model.Room:Thermostat"
self.multi_level_switch_property = {"Test": MultiLevelSwitchPropertyMock()}
self.multi_level_switch_property["Test"].switch_type = "temperature"
self.multi_level_sensor_property = {"Test": MultiLevelSensorPropertyMock()}
class CoverMock(DeviceMock):
"""devolo Home Control cover device mock."""
def __init__(self) -> None:
"""Initialize the mock."""
super().__init__()
self.multi_level_switch_property = {
"devolo.Blinds": MultiLevelSwitchPropertyMock()
}
class RemoteControlMock(DeviceMock):
"""devolo Home Control remote control device mock."""
@ -195,6 +206,19 @@ class HomeControlMockClimate(HomeControlMock):
self.publisher.unregister = MagicMock()
class HomeControlMockCover(HomeControlMock):
"""devolo Home Control gateway mock with cover devices."""
def __init__(self, **kwargs: Any) -> None:
"""Initialize the mock."""
super().__init__()
self.devices = {
"Test": CoverMock(),
}
self.publisher = Publisher(self.devices.keys())
self.publisher.unregister = MagicMock()
class HomeControlMockRemoteControl(HomeControlMock):
"""devolo Home Control gateway mock with remote control device."""