hue 0.0.1

The beginnings of a Philips Hue client library
1
2
3
4
5
6
7
8
9
10
11
12
13
//! An example of using the raw types and bridge API
extern crate hue;
extern crate serialize;
use serialize::json::ToJson;
use hue::rest_api::light::Light;

fn main() {
  println!("Version: {}.{}.{}", env!("CARGO_PKG_VERSION_MAJOR"), env!("CARGO_PKG_VERSION_MINOR"), env!("CARGO_PKG_VERSION_PATCH"));
  let mut bridge = hue::bridge::Bridge::new("192.168.1.10".to_string(), "newdeveloper".to_string());
  let mut state = hue::rest_api::light::State{on: None, bri: None, hue: None, sat: None, xy: None, ct: None, alert: None, effect: None, colormode: None, reachable: None, transitiontime: None };
  state.on = Some(true);
  bridge.set_state("1", state);
}