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(""); } }
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(""); } }