Method SetColorTemperatureAsync
- Namespace
- Yeelight
- Assembly
- YeelightClient.dll
SetColorTemperatureAsync(int, TimeSpan?, CancellationToken)
Sets the colour temperature, which switches the light to ColorTemperature. Only a light that is on accepts it.
public Task SetColorTemperatureAsync(int kelvin, TimeSpan? transition = null, CancellationToken cancellationToken = default)
Parameters
kelvinintThe colour temperature, from 1700 to 6500. The range of a light depends on its model.
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.