C# Класс HueLibrary.Bridge

Represents a Hue bridge.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Bridge ( ) : Newtonsoft.Json

Default constructor for the bridge. Requires manually setting the IP and userId.

Bridge ( string ip ) : Newtonsoft.Json

Constructor for the bridge with IP provided. Requires manually setting the userId.

Bridge ( string ip, string userId ) : Newtonsoft.Json

Constructor for the bridge with IP and username provided.

FindAsync ( ) : Task

Attempts to find a bridge on your network and create an object for it. Returns null if no bridge is found.

FindNewLightsAsync ( ) : System.Threading.Tasks.Task

Instructs the bridge to search for new, unknown lights.

GetLightAsync ( string id ) : Task

Gets a light with the given id known to the bridge, or null if no light is found.

GetLightsAsync ( ) : Task>

Gets all lights known to the bridge.

PingAsync ( ) : Task

Sends a basic command to the bridge and returns whether it receives the expected response.

RegisterAsync ( ) : Task

Registers the application with the bridge and returns if the authorization succeeded.

Приватные методы

Метод Описание
HttpGetAsync ( string commandUrl ) : Task

Sends a GET command via HTTP and returns the response.

HttpPutAsync ( string commandUrl, string body ) : Task

Sends a PUT command via HTTP and returns the response.

Описание методов

Bridge() публичный Метод

Default constructor for the bridge. Requires manually setting the IP and userId.
public Bridge ( ) : Newtonsoft.Json
Результат Newtonsoft.Json

Bridge() публичный Метод

Constructor for the bridge with IP provided. Requires manually setting the userId.
public Bridge ( string ip ) : Newtonsoft.Json
ip string
Результат Newtonsoft.Json

Bridge() публичный Метод

Constructor for the bridge with IP and username provided.
public Bridge ( string ip, string userId ) : Newtonsoft.Json
ip string
userId string
Результат Newtonsoft.Json

FindAsync() публичный статический Метод

Attempts to find a bridge on your network and create an object for it. Returns null if no bridge is found.
public static FindAsync ( ) : Task
Результат Task

FindNewLightsAsync() публичный Метод

Instructs the bridge to search for new, unknown lights.
public FindNewLightsAsync ( ) : System.Threading.Tasks.Task
Результат System.Threading.Tasks.Task

GetLightAsync() публичный Метод

Gets a light with the given id known to the bridge, or null if no light is found.
public GetLightAsync ( string id ) : Task
id string
Результат Task

GetLightsAsync() публичный Метод

Gets all lights known to the bridge.
public GetLightsAsync ( ) : Task>
Результат Task>

PingAsync() публичный Метод

Sends a basic command to the bridge and returns whether it receives the expected response.
public PingAsync ( ) : Task
Результат Task

RegisterAsync() публичный Метод

Registers the application with the bridge and returns if the authorization succeeded.
public RegisterAsync ( ) : Task
Результат Task