From bbf64483e7cde90b9f697f396eba3362d489cbc8 Mon Sep 17 00:00:00 2001 From: dougiteixeira <31328123+dougiteixeira@users.noreply.github.com> Date: Wed, 26 Jan 2022 07:34:18 -0300 Subject: [PATCH] Fix send command in vacuum Tuya (#64949) --- homeassistant/components/tuya/vacuum.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/tuya/vacuum.py b/homeassistant/components/tuya/vacuum.py index c10c6a05980..832128a8b3e 100644 --- a/homeassistant/components/tuya/vacuum.py +++ b/homeassistant/components/tuya/vacuum.py @@ -200,8 +200,10 @@ class TuyaVacuumEntity(TuyaEntity, StateVacuumEntity): """Set fan speed.""" self._send_command([{"code": DPCode.SUCTION, "value": fan_speed}]) - def send_command(self, command: str, params: str = None, **kwargs: Any) -> None: + def send_command( + self, command: str, params: list[str] | None = None, **kwargs: Any + ) -> None: """Send raw command.""" - if params is None: + if not params: raise ValueError("Params cannot be omitted for Tuya vacuum commands") - self._send_command([{"code": command, "value": params}]) + self._send_command([{"code": command, "value": params[0]}])