mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Improve type hints in tuya vacuum (#90041)
This commit is contained in:
parent
2a0401366b
commit
f01f5e1d2a
@ -190,9 +190,14 @@ class TuyaVacuumEntity(TuyaEntity, StateVacuumEntity):
|
|||||||
self._send_command([{"code": DPCode.SUCTION, "value": fan_speed}])
|
self._send_command([{"code": DPCode.SUCTION, "value": fan_speed}])
|
||||||
|
|
||||||
def send_command(
|
def send_command(
|
||||||
self, command: str, params: dict | list | None = None, **kwargs: Any
|
self,
|
||||||
|
command: str,
|
||||||
|
params: dict[str, Any] | list[Any] | None = None,
|
||||||
|
**kwargs: Any,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Send raw command."""
|
"""Send raw command."""
|
||||||
if not params:
|
if not params:
|
||||||
raise ValueError("Params cannot be omitted for Tuya vacuum commands")
|
raise ValueError("Params cannot be omitted for Tuya vacuum commands")
|
||||||
|
if not isinstance(params, list):
|
||||||
|
raise TypeError("Params must be a list for Tuya vacuum commands")
|
||||||
self._send_command([{"code": command, "value": params[0]}])
|
self._send_command([{"code": command, "value": params[0]}])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user