1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 04:50:05 +00:00

Use entity category in devolo Home Control (#59104)

* Use entity category

* Add tests
This commit is contained in:
Guido Schmitz
2021-11-05 13:11:48 +01:00
committed by GitHub
parent d709fcdd30
commit 442d65e8da
4 changed files with 37 additions and 5 deletions

View File

@@ -57,6 +57,16 @@ class BinarySensorMock(DeviceMock):
self.binary_sensor_property = {"Test": BinarySensorPropertyMock()}
class BinarySensorMockOverload(DeviceMock):
"""devolo Home Control disabled binary sensor device mock."""
def __init__(self) -> None:
"""Initialize the mock."""
super().__init__()
self.binary_sensor_property = {"Overload": BinarySensorPropertyMock()}
self.binary_sensor_property["Overload"].sensor_type = "overload"
class RemoteControlMock(DeviceMock):
"""devolo Home Control remote control device mock."""
@@ -90,12 +100,15 @@ class HomeControlMock(HomeControl):
class HomeControlMockBinarySensor(HomeControlMock):
"""devolo Home Control gateway mock with binary sensor device."""
"""devolo Home Control gateway mock with binary sensor devices."""
def __init__(self, **kwargs: Any) -> None:
"""Initialize the mock."""
super().__init__()
self.devices = {"Test": BinarySensorMock()}
self.devices = {
"Test": BinarySensorMock(),
"Overload": BinarySensorMockOverload(),
}
self.publisher = Publisher(self.devices.keys())
self.publisher.unregister = MagicMock()