python-kasa/kasa/tests/smart/modules
Steven B c5d65b624b
Make get_module return typed module (#892)
Passing in a string still works and returns either `IotModule` or
`SmartModule` type when called on `IotDevice` or `SmartDevice`
respectively. When calling on `Device` will return `Module` type.

Passing in a module type is then typed to that module, i.e.:
```py
smartdev.get_module(FanModule)  # type is FanModule
smartdev.get_module("FanModule")  # type is SmartModule
```
Only thing this doesn't do is check that you can't pass an `IotModule`
to a `SmartDevice.get_module()`. However there is a runtime check which
will return null if the passed `ModuleType` is not a subclass of
`SmartModule`.

Many thanks to @cdce8p for helping with this.
2024-05-03 17:01:21 +02:00
..
__init__.py Add T315 fixture, tests for humidity&temperature modules (#802) 2024-03-06 18:04:09 +00:00
test_fan.py Make get_module return typed module (#892) 2024-05-03 17:01:21 +02:00
test_humidity.py Refactor split smartdevice tests to test_{iot,smart}device (#822) 2024-03-15 15:55:48 +00:00
test_light_effect.py Add LightEffectModule for dynamic light effects on SMART bulbs (#887) 2024-05-02 16:31:12 +02:00
test_temperature.py Add support for KH100 hub (#847) 2024-04-22 16:24:15 +02:00
test_temperaturecontrol.py Improve temperature controls (#872) 2024-05-02 13:05:26 +00:00
test_waterleak.py Add fixture for waterleak sensor T300 (#897) 2024-05-03 15:24:34 +02:00