internal LightCollection(LifxClient client, string id, string label, List <Light> lights) { this.client = client; Id = id; Label = label; this.lights = lights; }
public static List <Location> AsLocations(this IEnumerable <Light> lights) { Dictionary <Light.CollectionSpec, List <Light> > groups = new Dictionary <Light.CollectionSpec, List <Light> >(); foreach (Light light in lights) { if (!groups.ContainsKey(light.location)) { groups[light.location] = new List <Light>(); } groups[light.location].Add(light); } // Grab client from a light LifxClient client = (groups.Count > 0) ? groups.First().Value.First().Client : null; return(groups.Select(entry => new Location(client, entry.Key.id, entry.Key.name, entry.Value)).ToList()); }
public Group(LifxClient client, string id, string label, List <Light> lights) : base(client, id, label, lights) { }
public Location(LifxClient client, string id, string label, List <Light> lights) : base(client, id, label, lights) { }