Table of Contents

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

kelvin int

The colour temperature, from 1700 to 6500. The range of a light depends on its model.

transition TimeSpan?

How long the change takes, or null for a sudden one.

cancellationToken CancellationToken

To 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.