BackgroundTasks.LightControllerVoiceCommandService.ExecutePhrase C# (CSharp) Method

ExecutePhrase() private method

Converts a phrase to a light command and executes it.
private ExecutePhrase ( Light light, string phrase ) : System.Threading.Tasks.Task
light Light
phrase string
return System.Threading.Tasks.Task
        private async Task ExecutePhrase(Light light, string phrase)
        {
            if (phrase == "On")
            {
                light.State.On = true;
            }
            else if (phrase == "Off")
            {
                light.State.On = false;
            }
            else if (_colors.ContainsKey(phrase))
            {
                light.State.Hue = _colors[phrase].H;
                light.State.Saturation = _colors[phrase].S;
                light.State.Brightness = _colors[phrase].B;
            }
            else
            {
                var response = CreateCortanaResponse("Launching HueLightController");
                await _voiceServiceConnection.RequestAppLaunchAsync(response);
            }
        }