Crate lifx_core

source ·
Expand description

This crate provides low-level message types and structures for dealing with the LIFX LAN protocol.

This lets you control lights on your local area network. More info can be found here: https://lan.developer.lifx.com/

Since this is a low-level library, it does not deal with issues like talking to the network, caching light state, or waiting for replies. This should be done at a higher-level library.

Discovery

To discover lights on your LAN, send a Message::GetService message as a UDP broadcast to port 56700. When a device is discovered, the Service types and IP port are provided. To get additional info about each device, send additional Get messages directly to each device (by setting the FrameAddress::target field to the bulbs target ID, and then send a UDP packet to the IP address associated with the device).

Reserved fields

When constructing packets, you must always set every reserved field to zero. However, it’s possible to receive packets with these fields set to non-zero values. Be conservative in what you send, and liberal in what you accept.

Unknown values

It’s common to see packets for LIFX bulbs that don’t match the documented protocol. These are suspected to be internal messages that are used by official LIFX apps, but that aren’t documented.

Structs

Options used to construct a RawMessage.
The Frame section contains information about the following:
The Frame Address section contains the following routing information:
Bulb color (Hue-Saturation-Brightness-Kelvin)
Lifx strings are fixed-length (32-bytes maximum)
The raw message structure

Enums

Controls how/when multizone devices apply color changes
Various message encoding/decoding errors
Decoded LIFX Messages
What services are exposed by the device.

Functions

Describe (in english words) the color temperature as given in kelvin.
Look up info about what a LIFX product supports.