lifxi

Crates.iolifxi
lib.rslifxi
version0.1.1
sourcesrc
created_at2018-12-23 00:18:37.073767
updated_at2018-12-24 04:32:00.690777
descriptionControl LIFX devices.
homepage
repositoryhttps://github.com/Aehmlo/lifxi
max_upload_size
id103350
size125,277
Alex Hamilton (Aehmlo)

documentation

https://docs.rs/lifxi

README

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.

Commit count: 52

cargo fmt