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); }
public ChromaInstance(IClient client) { this.client = client; container = this; }