Table of Contents

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

name string

The name, at most 64 bytes in UTF-8. The specification suggests to encode a name with characters that are not ASCII with Base64 first.

cancellationToken CancellationToken

To stop waiting for the answer.

Returns

Task

A task that ends when the light has answered.

Exceptions

ArgumentNullException

name is null.

ArgumentException

The name is longer than 64 bytes.