Add Fan interface for SMART devices (#873)

Enables the Fan interface for devices supporting that component.
Currently the only device with a fan is the ks240 which implements it as
a child device. This PR adds a method `get_module` to search the child
device for modules if it is a WallSwitch device type.
This commit is contained in:
Steven B
2024-04-30 17:42:53 +01:00
committed by GitHub
parent 7db989e2ec
commit 16f17a7729
6 changed files with 124 additions and 18 deletions

View File

@@ -10,7 +10,7 @@ brightness = parametrize("brightness smart", component_filter="brightness")
@brightness
async def test_brightness_component(dev: SmartDevice):
"""Test brightness feature."""
brightness = dev.modules.get("Brightness")
brightness = dev.get_module("Brightness")
assert brightness
assert isinstance(dev, SmartDevice)
assert "brightness" in dev._components