mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-06 10:44:04 +00:00
Fix fan speed level when off and derive smart fan module from common fan interface (#957)
Picked this up while updating the [Fan platform PR](https://github.com/home-assistant/core/pull/116605) for HA. The smart fan module was not correctly deriving from the common interface and the speed_level is reported as >0 when off.
This commit is contained in:
@@ -64,6 +64,11 @@ async def test_fan_module(dev: SmartDevice, mocker: MockerFixture):
|
||||
assert fan.fan_speed_level == 1
|
||||
assert device.is_on
|
||||
|
||||
# Check that if the device is off the speed level is 0.
|
||||
await device.set_state(False)
|
||||
await dev.update()
|
||||
assert fan.fan_speed_level == 0
|
||||
|
||||
await fan.set_fan_speed_level(4)
|
||||
await dev.update()
|
||||
assert fan.fan_speed_level == 4
|
||||
|
Reference in New Issue
Block a user