mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-01-08 22:07:06 +00:00
Add get_alias for get_feature
This commit is contained in:
parent
cc9930ecc6
commit
6ca0493406
@ -21,3 +21,6 @@ class Fan(Module, ABC):
|
|||||||
self, level: int
|
self, level: int
|
||||||
) -> Annotated[dict, FeatureAttribute()]:
|
) -> Annotated[dict, FeatureAttribute()]:
|
||||||
"""Set fan speed level."""
|
"""Set fan speed level."""
|
||||||
|
|
||||||
|
|
||||||
|
Fan.get_fan_speed_level = Fan.fan_speed_level.fget # type: ignore[attr-defined]
|
||||||
|
@ -96,6 +96,9 @@ async def test_fan_features(dev: SmartDevice, mocker: MockerFixture):
|
|||||||
assert fan
|
assert fan
|
||||||
expected_feature = fan._module_features["fan_speed_level"]
|
expected_feature = fan._module_features["fan_speed_level"]
|
||||||
|
|
||||||
|
fan_speed_level_feature = fan.get_feature(fan.get_fan_speed_level)
|
||||||
|
assert expected_feature == fan_speed_level_feature
|
||||||
|
|
||||||
fan_speed_level_feature = fan.get_feature(Fan.set_fan_speed_level)
|
fan_speed_level_feature = fan.get_feature(Fan.set_fan_speed_level)
|
||||||
assert expected_feature == fan_speed_level_feature
|
assert expected_feature == fan_speed_level_feature
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user