Table of Contents

Method ProbeAsync

Namespace
Yeelight
Assembly
YeelightClient.dll

ProbeAsync(IPAddress, CancellationToken)

Asks one address whether a Yeelight light is there, with a search that is sent straight to it. For networks that do not pass the multicast or the broadcast of a search (a VPN, a network with its lights on another subnet): a light answers a search that is sent to it, wherever it is, as long as the address can be reached.

public Task<YeelightDevice?> ProbeAsync(IPAddress address, CancellationToken cancellationToken = default)

Parameters

address IPAddress

The IP address of the light, on the local network (a private, link-local or loopback address).

cancellationToken CancellationToken

To stop waiting.

Returns

Task<YeelightDevice>

The light (it is in Devices from now on), or null when nothing answered within three seconds.

Exceptions

ArgumentNullException

address is null.

ArgumentException

The address is not an address of the local network.

ObjectDisposedException

The client is disposed.

OperationCanceledException

The wait was cancelled, or the client was disposed while it waited.

ProbeAsync(IPAddress, int, CancellationToken)

Asks one address whether a Yeelight light is there, on a UDP port other than the usual one (DiscoveryPort). For a simulator, or a light behind a forwarded port. See ProbeAsync(IPAddress, CancellationToken).

public Task<YeelightDevice?> ProbeAsync(IPAddress address, int port, CancellationToken cancellationToken = default)

Parameters

address IPAddress

The IP address of the light, on the local network (a private, link-local or loopback address).

port int

The UDP port that the light answers searches on, from 1 to 65535.

cancellationToken CancellationToken

To stop waiting.

Returns

Task<YeelightDevice>

The light (it is in Devices from now on), or null when nothing answered within three seconds.

Exceptions

ArgumentNullException

address is null.

ArgumentException

The address is not an address of the local network.

ArgumentOutOfRangeException

port is not a port.

ObjectDisposedException

The client is disposed.

OperationCanceledException

The wait was cancelled, or the client was disposed while it waited.

ProbeAsync(string, CancellationToken)

Asks one address whether a Yeelight light is there. See ProbeAsync(IPAddress, CancellationToken).

public Task<YeelightDevice?> ProbeAsync(string address, CancellationToken cancellationToken = default)

Parameters

address string

The IP address of the light, for example 192.168.1.50.

cancellationToken CancellationToken

To stop waiting.

Returns

Task<YeelightDevice>

The light, or null when nothing answered within three seconds.

Exceptions

ArgumentNullException

address is null.

ArgumentException

The text is not an IP address, or not one of the local network.

ObjectDisposedException

The client is disposed.

OperationCanceledException

The wait was cancelled, or the client was disposed while it waited.