Table of Contents

Class YeelightClientOptions

Namespace
Yeelight
Assembly
YeelightClient.dll

The settings of a YeelightClient.

public sealed class YeelightClientOptions
Inheritance
YeelightClientOptions
Inherited Members

Remarks

The defaults suit most networks and most lights. The client reads the options once, when it is made: changing an options object afterwards changes nothing.

Properties

AutoConnect

Gets whether the client connects to a light as soon as it is found. This is what keeps the state of the lights up to date (a light reports every change to the connections that it has). A light takes at most four connections (ConnectionsPerLight) and the apps of the same network need theirs too, so a client that only sends the odd command can set this to false: a light then connects when it gets a command, or when ConnectAsync(CancellationToken) is called. The default is true.

CommandTimeout

Gets how long a command waits for the answer of the light before it fails with Timeout. The default is 3 seconds.

CommandsPerMinute

Gets the number of commands a minute that the client sends to a light on one connection. A light accepts 60 (CommandsPerMinute) and answers client quota exceeded to more: the client holds a command back until it is its turn, and fails it with RateLimited when that would take more than two seconds. The default is 60.

ConnectTimeout

Gets how long the client waits for a connection to a light to be made before it gives up and tries again. The default is 3 seconds.

Default

Gets the default options.

DiscoveryPort

Gets the UDP port that lights are searched on and that they announce themselves to. A light uses DiscoveryPort (1982); another port is for a simulator or a forwarded port.

KeepAliveInterval

Gets how long a connection may be quiet before the client asks the light something, to find out whether it is still there (a light that lost its power does not close its connection). Zero turns it off. The default is 60 seconds.

MaxDevices

Gets the most lights that the client keeps. Anyone on the network can announce a light, so what the client keeps is bounded: once it has this many, the announcements of other lights are ignored (a warning is logged once). The default is 1000, which is more than any network has; a client for a home can set a lower one.

RefreshOnConnect

Gets whether the client reads all the properties of a light each time that a connection to it is made, with one get_prop command. A light only tells what changes, so this is how the whole state is known. The default is true.

SearchBurst

Gets how many times a search is sent when it is due. UDP over WiFi loses packets, and a light that saves power can miss one. The default is 3, a second apart.

UseBroadcast

Gets whether a search is also sent as a broadcast, next to the multicast. Some lights never hear the multicast group (an access point or a router that does not pass it on to every WiFi client) and do answer the broadcast. The default is true.