Skip to content
/ lifxi Public

A Rust wrapper for LIFX bulbs.

Notifications You must be signed in to change notification settings

Aehmlo/lifxi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lifxi

Build Status Crates.io Documentation

Control LIFX devices over (eventually LAN and) the internet.

Getting Started

This crate currently only supports control via the web API. To get started, go to the LIFX account settings page and create an access token.

The Client struct is the entry point for all functionality in this crate. It's advised to have a single instance of this client, as it holds a connection pool. Depending on your architecture, the lazy-static crate may be a good choice:

lazy_static! {
    static ref CLIENT: Client = Client::new("secret");
}

Here's a simple demo to ensure everything's working:

use lifxi::http::*;
fn main() {
    let client = Client::new("your secret here");
    let _result = client
        .select(Selector::All)
        .set_state()
        .power(true)
        .color(Color::Red)
        .brightness(0.4)
        .send();
}

If running that example results in all of your LIFX bulbs turning on and changing to red, you're in business! Head over to the docs to see more.

Contributing

Contributions are welcome! Submit a pull request, file an issue, or feel free to just discuss in the comments. The LIFX HTTP API documentation and LAN protocol documentation will likely be helpful in any development efforts.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as below, without any additional terms or conditions.

License

Licensed under the Apache License, Version 2.0 or the MIT License, at your option.

About

A Rust wrapper for LIFX bulbs.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages