Exemple #1
0
        public async void return_two_lights()
        {
            var lightsManager = new LightsManager(_client);
            await lightsManager.RetrieveLights();

            Check.That(lightsManager.Lights.ToList().Count).IsEqualTo(2);
        }
        private async void OffLights(object sender, ElapsedEventArgs e)
        {
            var nowTime = DateTime.Now.TimeOfDay;

            foreach (var hourOff in _hoursOff)
            {
                if (hourOff.Hour.Hours == nowTime.Hours && hourOff.Hour.Minutes == nowTime.Minutes)
                {
                    await _lightsManager.RetrieveLights();

                    await _lightsManager.StopAllLights();

                    _timerToHoursOff.Stop();
                }
            }
        }
Exemple #3
0
        public async void return_true_on_stop_all_light()
        {
            var lightsManager = new LightsManager(_client);
            await lightsManager.RetrieveLights();

            var result = await lightsManager.StopAllLights();

            Check.That(result).IsEqualTo(StateLight.Off);
        }
Exemple #4
0
        public async void return_true_on_set_color_one_light()
        {
            var lightsManager = new LightsManager(_client);
            await lightsManager.RetrieveLights();

            var lights = lightsManager.Lights;
            var result = await lightsManager.SetColorOnLight(lights.First(), "#FF00AA");

            Check.That(result).IsEqualTo(StateLight.On);
        }
Exemple #5
0
        public async void return_true_on_start_one_light()
        {
            var lightsManager = new LightsManager(_client);
            await lightsManager.RetrieveLights();

            var lights = lightsManager.Lights;
            var result = await lightsManager.StartLight(lights.First());

            Check.That(result).IsEqualTo(StateLight.On);
        }
Exemple #6
0
        public async void return_on_or_state_on_one_light()
        {
            var lightsManager = new LightsManager(_client);
            await lightsManager.RetrieveLights();

            var lights = lightsManager.Lights;
            await lightsManager.StartLight(lights.First());

            var state = await lightsManager.GetStateOfLight(lights.First());

            Check.That(state).IsEqualTo(StateLight.On);
        }