예제 #1
0
 public LifxBulb(string json, LifxManager manager)
 {
     JToken bulbData = JObject.Parse(json);
         this.manager = manager;
         id = bulbData.Value<string>("id");
         uuid = bulbData.Value<string>("uuid");
         label = bulbData.Value<string>("label");
         connected = bulbData.Value<bool>("connected");
         power = bulbData.Value<string>("power");
         brightness = bulbData.Value<float>("brightness");
         color = new LifxColor(bulbData.Value<JToken>("color").ToString());
         group = new LifxGroup(bulbData.Value<JToken>("group").ToString(), manager);
         location = new LifxLocation(bulbData.Value<JToken>("location").ToString(), manager);
         productName = bulbData.Value<string>("product_name");
         capabilities = new LifxCapability(bulbData.Value<JToken>("capabilities").ToString());
         lastSeen = bulbData.Value<string>("last_seen");
         secondsSinceSeen = bulbData.Value<double>("seconds_since_seen");
 }
예제 #2
0
 public bool setColor(LifxColor color, int duration)
 {
     return manager.setColor(color.getLifxColorString(), duration, getSelector());
 }