![]() ![]() To turn on a light, we need to provide the ID of the light the state of which needs to change /id:/. With the list of lights in hand, we can create methods to control them. Return JsonConvert.DeserializeObject>(data) Var data = client.GetStringAsync(" ").Result LIFX has a simple endpoint to list all lights: public static List GetLights() Discovering Available Lightsīefore we can control LIFX lights, we need to find them. ![]() We will use this client and API to create methods to control our lights. This HttpClient can now be used to send request to the LIFX HTTP WEB API. private static HttpClient client Ĭ = new AuthenticationHeaderValue("Bearer", ) With C# it's easy to set up a HttpClient with that token attached. We will need to obtain an authentication token and use it when calling the API. LIFX Light Bulbs - LIFX is a WiFi connected smart light and they provide an easy to use HTTP WEB API with great documentation. ![]() Before getting started, you will need access to / familiarity with ![]()
0 Comments
Leave a Reply. |