Table of Contents

Method AdjustBrightnessAsync

Namespace
Yeelight
Assembly
YeelightClient.dll

AdjustBrightnessAsync(int, TimeSpan?, CancellationToken)

Changes the brightness by a percentage of what it is now.

public Task AdjustBrightnessAsync(int percentage, TimeSpan? duration = null, CancellationToken cancellationToken = default)

Parameters

percentage int

The percentage to change it by, from -100 to 100 (-20 makes it 20 percent less).

duration TimeSpan?

How long the change takes, or null for the shortest time that a light supports (30 milliseconds).

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.