Method SetHsvAsync
- Namespace
- Yeelight
- Assembly
- YeelightClient.dll
SetHsvAsync(int, int, TimeSpan?, CancellationToken)
Sets the colour as a hue and a saturation, which switches the light to Hsv. Only a light that is on accepts it.
public Task SetHsvAsync(int hue, int saturation, TimeSpan? transition = null, CancellationToken cancellationToken = default)
Parameters
hueintThe hue, 0 to 359.
saturationintThe saturation, 0 to 100.
transitionTimeSpan?How long the change takes, or
nullfor a sudden one.cancellationTokenCancellationTokenTo stop waiting for the answer.
Returns
- Task
A task that ends when the light has answered.
Exceptions
- ArgumentOutOfRangeException
An argument is out of the range that the protocol allows.