示例#1
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("");
            }
        }
示例#2
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("");
            }
        }