private async void allLightsOn() { var command = new LightCommand(); command.On = true; command.Brightness = 254; // to avoid switching on and still see nothing HueResults results = await client.SendCommandAsync(command); statusLabel.Text = gatherResults(results); foreach (System.Windows.Forms.Control control in flowLayoutPanel.Controls) { LightControl lc = (LightControl)control; lc.Resync(); } }
private async void allLightsOff() { var command = new LightCommand(); command.On = false; Task <HueResults> task = client.SendCommandAsync(command); HueResults results = await task; statusLabel.Text = gatherResults(results); foreach (System.Windows.Forms.Control control in flowLayoutPanel.Controls) { LightControl lc = (LightControl)control; lc.Resync(); } }