Exemple #1
0
        public bool Execute()
        {
            // And sent by POST request to the Jeedom controler
            HTTPQuery query = new HTTPQuery(_jeedom, _RPCcommand);

            bool result = query.Execute();

            if (result)
                _response = query.Response;
            else
                _error = query.Error;

            return result;
        }
Exemple #2
0
        public bool Execute()
        {
            // And sent by POST request to the Jeedom controler
            HTTPQuery query = new HTTPQuery(_jeedom, _RPCcommand);

            bool result = query.Execute();

            if (result)
            {
                _response = query.Response;
            }
            else
            {
                _error = query.Error;
            }

            return(result);
        }
Exemple #3
0
        public string Scenario(int id, ScenarioType scenario)
        {
            string action = "";

            switch (scenario)
            {
                case ScenarioType.Disable:
                    action = "deactivate";
                    break;

                case ScenarioType.Enable:
                    action = "activate";
                    break;

                case ScenarioType.Start:
                    action = "start";
                    break;

                case ScenarioType.Stop:
                    action = "stop";
                    break;
            }

            Dictionary<string, object> command = new Dictionary<string, object>()
            {
                { "apikey", _api_key },
                { "type", "scenario" },
                { "action", action },
                { "id", id }
            };

            HTTPQuery query = new HTTPQuery(this, command);

            if (query.Execute())
                return query.Response;
            else
                return "";
        }
Exemple #4
0
        public string Command(int id)
        {
            Dictionary<string, object> command = new Dictionary<string, object>()
            {
                { "apikey", _api_key },
                { "type", "cmd" },
                { "id", id }
            };

            HTTPQuery query = new HTTPQuery(this, command);

            if (query.Execute())
                return query.Response;
            else
                return "";
        }