示例#1
0
        private async void SetUp()
        {
            await BridgeConnecter.BridgeConnection().ConfigureAwait(false);

            if (BridgeConnecter.Connected)
            {
                hueListener = new Listener();
            }
            else
            {
                this.Disable();
            }
        }
        public async Task SendCommand(string color)
        {
            var command = new LightCommand();

            if (color == "000000")
            {
                command.TurnOff();
            }
            else
            {
                command.TurnOn().SetColor(new RGBColor(color));
            }

            await BridgeConnecter.getClient().SendCommandAsync(command);
        }