Table of Contents

Method TurnOnAsync

Namespace
Yeelight
Assembly
YeelightClient.dll

TurnOnAsync(TimeSpan?, PowerOnMode, CancellationToken)

Switches the light on.

public Task TurnOnAsync(TimeSpan? transition = null, PowerOnMode mode = PowerOnMode.Normal, CancellationToken cancellationToken = default)

Parameters

transition TimeSpan?

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

mode PowerOnMode

The mode to switch on in.

cancellationToken CancellationToken

To stop waiting for the answer.

Returns

Task

A task that ends when the light has answered.

Exceptions

ArgumentOutOfRangeException

The transition is shorter than the light accepts.