Example #1
0
        public async Task <List <RequestResponse> > Send(DeviceContainer deviceContainer = null)
        {
            container = deviceContainer ?? this;
            var effectIds = new List <string>();
            var devices   = new List <IDevice>();
            var responses = new List <RequestResponse>();

            foreach (var device in container.Devices)
            {
                if (device.ActiveEffect == Effect.Undefined)
                {
                    continue;
                }

                if (!string.IsNullOrEmpty(device.EffectId))
                {
                    effectIds.Add(device.EffectId);
                }
                else
                {
                    devices.Add(device);
                }
            }

            responses.AddRange(await SetEffect(effectIds).ConfigureAwait(false));
            responses.AddRange(await SendDeviceUpdate(devices).ConfigureAwait(false));

            return(responses);
        }
Example #2
0
 public ChromaInstance(IClient client)
 {
     this.client = client;
     container   = this;
 }