diff --git a/kasa/interfaces/fan.py b/kasa/interfaces/fan.py index 9462ad88..54fcbe68 100644 --- a/kasa/interfaces/fan.py +++ b/kasa/interfaces/fan.py @@ -21,3 +21,6 @@ class Fan(Module, ABC): self, level: int ) -> Annotated[dict, FeatureAttribute()]: """Set fan speed level.""" + + +Fan.get_fan_speed_level = Fan.fan_speed_level.fget # type: ignore[attr-defined] diff --git a/tests/smart/modules/test_fan.py b/tests/smart/modules/test_fan.py index 9a6878e5..591dd000 100644 --- a/tests/smart/modules/test_fan.py +++ b/tests/smart/modules/test_fan.py @@ -96,6 +96,9 @@ async def test_fan_features(dev: SmartDevice, mocker: MockerFixture): assert fan 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) assert expected_feature == fan_speed_level_feature