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
percentageintThe percentage to change it by, from -100 to 100 (-20 makes it 20 percent less).
durationTimeSpan?How long the change takes, or
nullfor the shortest time that a light supports (30 milliseconds).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.