Crates.io | lifx-api-server |
lib.rs | lifx-api-server |
version | 0.1.15 |
source | src |
created_at | 2022-06-25 03:20:45.877625 |
updated_at | 2023-05-10 17:46:35.887801 |
description | A library/server that mimicks the official LIFX API using the local LAN protocol. |
homepage | |
repository | https://github.com/PixelCoda/lifx-api-server |
max_upload_size | |
id | 612752 |
size | 100,193 |
A library/server that mimicks the official LIFX API using the local LAN protocol.
Add the following line to your cargo.toml:
lifx-api-server = "0.1.15"
extern crate lifx_api_server;
fn main() {
let config = lifx_api_server::Config {
secret_key: format!("xxx"),
port: 8089
};
lifx_api_server::start(config);
println!("sync");
loop {
}
}
curl -X PUT "http://localhost:8089/v1/lights/all/state" -H "Authorization: Bearer xxx" -d "color=kelvin:9000"
extern crate lifx_rs as lifx;
fn main() {
let key = "xxx".to_string();
let mut api_endpoints: Vec<String> = Vec::new();
api_endpoints.push(format!("http://localhost:8089"));
let config = lifx::LifxConfig{
access_token: key.clone(),
api_endpoints: api_endpoints
};
let mut off_state = lifx::State::new();
off_state.power = Some(format!("off"));
// Turn off all lights
lifx::Light::set_state_by_selector(config.clone(), format!("all"), off_state);
}
Released under Apache 2.0 or MIT.
ADA: addr1qyp299a45tgvveh83tcxlf7ds3yaeh969yt3v882lvxfkkv4e0f46qvr4wzj8ty5c05jyffzq8a9pfwz9dl6m0raac7s4rac48
ALGO: VQ5EK4GA3IUTGSPNGV64UANBUVFAIVBXVL5UUCNZSDH544XIMF7BAHEDM4
ATOM: cosmos1wm7lummcealk0fxn3x9tm8hg7xsyuz06ul5fw9
BTC: bc1qh5p3rff4vxnv23vg0hw8pf3gmz3qgc029cekxz
ETH: 0x7A66beaebF7D0d17598d37525e63f524CfD23452
ERC20: 0x7A66beaebF7D0d17598d37525e63f524CfD23452
XLM: GCJAUMCO2L7PTYMXELQ6GHBTF25MCQKEBNSND2C4QMUPTSVCPEN3LCOG
XTZ: tz1SgJppPn56whprsDDGcqR4fxqCr2PXvg1R