示例#1
0
        private static void SendSpeechCommand(string command)
        {
            var    commandRequest = new CommandRequest();
            string parameters     = null;

            //temperature commands
            if (command.Contains("heat"))
            {
                if (command.Contains("on"))
                {
                    parameters = "heat-on";
                }
                else if (command.Contains("off"))
                {
                    parameters = "heat-off";
                }
            }
            //music commands
            else if (command.Contains("music"))
            {
                if (command.Contains("on"))
                {
                    parameters = "music-on";
                }
                else if (command.Contains("off"))
                {
                    parameters = "music-off";
                }
            }
            //light commands
            else if (command.Contains("light"))
            {
                if (command.Contains("on"))
                {
                    parameters = "light-on";
                }
                else if (command.Contains("off"))
                {
                    parameters = "light-off";
                }
            }
            //feeling tired
            else if (command.Contains("feeling"))
            {
                if (command.Contains("tired"))
                {
                    parameters = "feeling-tired";
                }
            }
            if (parameters != null)
            {
                commandRequest.Send(parameters);
            }
        }
示例#2
0
 public CommandResponse Command(CommandRequest <ICamera> command, bool checkStatus = true)
 {
     return(command.Send(checkStatus));
 }
示例#3
0
 public ICamera Command(CommandRequest <ICamera> command)
 {
     command.Send();
     return(this);
 }