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