Fix send command in vacuum Tuya (#64949)

This commit is contained in:
dougiteixeira 2022-01-26 07:34:18 -03:00 committed by GitHub
parent d49b821565
commit bbf64483e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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]}])