Ejemplo n.º 1
0
        public bool SaveEntertainment()
        {
            string newid         = string.Empty;
            bool   success       = false;
            Group  entertainment = new Group()
            {
                name   = _entertainmentModel.Name,
                @class = "TV",
                lights = ListLights.Select(x => x.Light.Id).ToList(),
                type   = "Entertainment"
            };

            success = _bridge.CreateObject(entertainment);

            if (success)
            {
                Location loc = new Location();
                newid = _bridge.LastCommandMessages.LastSuccess.value;
                foreach (EntertainmentLight el in ListLights)
                {
                    loc.Add(el.Light.Id, el.Location);
                }

                success = success && _bridge.SetEntertrainementLightLocation(newid, loc);
            }


            return(success);
        }
Ejemplo n.º 2
0
		public async Task<IEnumerable<Light>> ListLights(ISelector selector)
		{
			ListLights api = new ListLights(this.Identity);
			return await api.Get(selector);
		}