You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A .NET Standard 1.3 library for LIFX.
Supports .NET, UWP, Xamarin iOS, Xamarin Android, and any other .NET Platform that has implemented .NET Standard 1.3+.
client=awaitLifxNet.LifxClient.CreateAsync();client.DeviceDiscovered+=Client_DeviceDiscovered;client.DeviceLost+=Client_DeviceLost;client.StartDeviceDiscovery();
...private async voidClient_DeviceDiscovered(objectsender,LifxNet.LifxClient.DeviceDiscoveryEventArgse){varbulb=e.DeviceasLifxNet.LightBulb;awaitclient.SetDevicePowerStateAsync(bulb,true);//Turn bulb onawaitclient.SetColorAsync(bulb,Colors.Red,2700);//Set color to Red and 2700K Temperature }
See the sample apps for more examples.
Note: Be careful with sending too many messages to your bulbs - LIFX recommends a max of 20 messages pr second pr bulb.
This is especially important when using sliders to change properties of the bulb - make sure you use a throttling
mechanism to avoid issues with your bulbs. See the sample app for one way to handle this.