Method SendCommandAsync
- Namespace
- Yeelight
- Assembly
- YeelightClient.dll
SendCommandAsync(string, IReadOnlyList<object?>?, CancellationToken)
Sends any command, for what this class has no method for (the commands of the background light, for one: bg_set_rgb).
The method is sent as it is.
public Task SendCommandAsync(string method, IReadOnlyList<object?>? parameters = null, CancellationToken cancellationToken = default)
Parameters
methodstringThe method, as the protocol names it.
parametersIReadOnlyList<object>The parameters: numbers, text and truth values.
cancellationTokenCancellationTokenTo stop waiting for the connection.
Returns
- Task
A task that ends when the command has been sent.
Exceptions
- ArgumentException
methodis empty, or a parameter is not a number, text or a truth value.- YeelightException
The connection is lost.