LifxNet
A .NET library for controlling LIFX light bulbs
Install / Use
/learn @dotMorten/LifxNetREADME
LifxNet
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+.
For Cloud Protocol based implementation, check out isaacrlevin's repo
Sponsoring
If you like this library and use it a lot, consider sponsoring me. Anything helps and encourages me to keep going.
See here for details: https://github.com/sponsors/dotMorten
NuGet
Get the Nuget package here:
PM> Install-Package LifxNet
Tested with LIFX 2.0 Firmware.
Based on the official LIFX protocol docs
####Usage
client = await LifxNet.LifxClient.CreateAsync();
client.DeviceDiscovered += Client_DeviceDiscovered;
client.DeviceLost += Client_DeviceLost;
client.StartDeviceDiscovery();
...
private async void Client_DeviceDiscovered(object sender, LifxNet.LifxClient.DeviceDiscoveryEventArgs e)
{
var bulb = e.Device as LifxNet.LightBulb;
await client.SetDevicePowerStateAsync(bulb, true); //Turn bulb on
await client.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.
Related Skills
node-connect
339.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
339.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.9kCommit, push, and open a PR
