Method SetNameAsync
- Namespace
- Yeelight
- Assembly
- YeelightClient.dll
SetNameAsync(string, CancellationToken)
Gives the device a name, which is stored on the device and reported when it is found (the Yeelight app keeps its own names in the cloud, so the two can differ).
public Task SetNameAsync(string name, CancellationToken cancellationToken = default)
Parameters
namestringThe name, at most 64 bytes in UTF-8. The specification suggests to encode a name with characters that are not ASCII with Base64 first.
cancellationTokenCancellationTokenTo stop waiting for the answer.
Returns
- Task
A task that ends when the light has answered.
Exceptions
- ArgumentNullException
nameisnull.- ArgumentException
The name is longer than 64 bytes.