static async Task RunLightCommand02()
        {
            LocalHueClient client = await HueManager.GetClient();

            if (client == null)
            {
                return;
            }

            var command = new LightCommand();

            // some random settings for tests
            command.SetColor(new RGBColor(255, 255, 255));
            client.SendCommandAsync(command);
            Thread.Sleep(1000);
            command.TurnOff();
            client.SendCommandAsync(command);
            Thread.Sleep(1000);
            command.TurnOn();
            client.SendCommandAsync(command);
            Thread.Sleep(1000);
            command.TurnOff();
            client.SendCommandAsync(command);
            Thread.Sleep(1000);
            command.TurnOn();
            client.SendCommandAsync(command);
            Thread.Sleep(1000);
            command.SetColor(new RGBColor(127, 0, 255));
            client.SendCommandAsync(command);
        }
        private void Cue2Button_OnClickButton_Click(object sender, RoutedEventArgs e)
        {
            HueManager.GetClient();
            Thread.Sleep(500);
            RunLightCommand02();

            Console.WriteLine("Ran some lights");
        }
Esempio n. 3
0
        public static void Main(string[] args)
        {
            // Doesn't need to register
            //Register();
            //Thread.Sleep(500);
            HueManager.GetClient();
            Thread.Sleep(500);
            RunLightCommand();

            Console.WriteLine("Ran some lights");
        }
Esempio n. 4
0
 private async void connectBridge()
 {
     try
     {
         hueCts.Cancel();
         hueCts = new CancellationTokenSource();
     }
     catch (Exception) { } // can't cancel unused token
     Debug.Log("Received button press");
     await HueManager.syncAsync(hueCts.Token);
 }
Esempio n. 5
0
 private void Awake()
 {
     base.Awake();
     if (instance)
     {
         Debug.LogError("two hue managers");
     }
     else
     {
         instance = this;
     }
 }
Esempio n. 6
0
 internal void Reset()
 {
     _lightColor0.SetColor(_lightColor0_Original);
     HueManager.setOrigRight(_lightColor0_Original);
     _lightColor1.SetColor(_lightColor1_Original);
     HueManager.setOrigLeft(_lightColor1_Original);
     if (_supportBoostColor)
     {
         _lightColor0Boost.SetColor(_lightColor0Boost_Original);
         _lightColor1Boost.SetColor(_lightColor1Boost_Original);
     }
 }