Просмотр исходного кода

Vacuum: async_set_fan_speed argument needs to be fan_speed, not speed.

Due to keyword argument use in the HA service calls, the name needs to match.
Issue #124
Jason Rumney 4 лет назад
Родитель
Сommit
764fb28a12

+ 2 - 2
custom_components/tuya_local/generic/vacuum.py

@@ -169,7 +169,7 @@ class TuyaLocalVacuum(TuyaLocalEntity, StateVacuumEntity):
         if self._fan_dps:
             return self._fan_dps.get_value(self._device)
 
-    async def async_set_fan_speed(self, speed, **kwargs):
+    async def async_set_fan_speed(self, fan_speed, **kwargs):
         """Set the fan speed of the vacuum."""
         if self._fan_dps:
-            await self._fan_dps.async_set_value(self._device, speed)
+            await self._fan_dps.async_set_value(self._device, fan_speed)

+ 1 - 1
tests/devices/test_kyvol_e30_vacuum.py

@@ -296,4 +296,4 @@ class TestKyvolE30Vacuum(MultiSensorTests, MultiSwitchTests, TuyaDeviceTestCase)
 
     async def test_async_set_fan_speed(self):
         async with assert_device_properties_set(self.subject._device, {FAN_DPS: "3"}):
-            await self.subject.async_set_fan_speed("gentle")
+            await self.subject.async_set_fan_speed(fan_speed="gentle")