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
transitionTimeSpan?How long the change takes, or
nullfor a sudden one.modePowerOnModeThe mode to switch on in.
cancellationTokenCancellationTokenTo 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.