public virtual void Stop()
        {
            State?.SetBrightness(0);

            //Wait, because we want to make sure we set the state on the lights before we set the state to null
            Task.Run(async() => {
                await Task.Delay(TimeSpan.FromMilliseconds(200)).ConfigureAwait(false);
                State = null;
            });
        }
Exemple #2
0
        public Task SetColors(IEnumerable <RGB> colors, CancellationToken token)
        {
            return(Task.Run(() =>
            {
                var i = 0;
                foreach (var color in colors)
                {
                    var state = new EntertainmentState();
                    state.SetRGBColor(new RGBColor((int)color.R, (int)color.G, (int)color.B));
                    state.SetBrightness(1);
                    hueLayer[i].State = state;

                    i++;
                }

                hueClient.ManualUpdate(streamingGroup);
            }));
        }
Exemple #3
0
 public virtual void Stop()
 {
     State = null;
 }