Table of Contents

Method SetBrightnessAsync

Namespace
Yeelight
Assembly
YeelightClient.dll

SetBrightnessAsync(int, TimeSpan?, CancellationToken)

Sets the brightness.

public Task SetBrightnessAsync(int brightness, TimeSpan? transition = null, CancellationToken cancellationToken = default)

Parameters

brightness int

The brightness, a percentage from 1 to 100.

transition TimeSpan?

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

cancellationToken CancellationToken

To stop waiting for the connection.

Returns

Task

A task that ends when the command has been sent.

Exceptions

ArgumentOutOfRangeException

An argument is out of the range that the protocol allows.

YeelightException

The connection is lost.