Exemplo n.º 1
0
        public RPCCommand(Jeedom jee, string method, Dictionary <string, object> vars)
        {
            _method = method;
            _vars   = vars;

            Init(jee);
        }
Exemplo n.º 2
0
        public Commands(Jeedom jee, JeedomEntities entities)
        {
            _jee      = jee;
            _entities = entities;

            Load();
        }
Exemplo n.º 3
0
        private void Init(Jeedom jee)
        {
            _jeedom   = jee;
            _response = string.Empty;
            _error    = string.Empty;

            // Our RPC command "object"
            Dictionary <string, object> request = new Dictionary <string, object>()
            {
                { "jsonrpc", "2.0" },
                { "id", new Random().Next(1, 9999) },
                { "method", _method },
                { "params", _vars }
            };

            // We inject the API key in the command parameters
            Dictionary <string, object> par = (Dictionary <string, object>)request["params"];

            par.Add("apikey", _jeedom._api_key);

            // Our RPC command is encapsulated by JSON...
            _RPCcommand = new Dictionary <string, object>()
            {
                { "request", JsonConvert.SerializeObject(request) }
            };
        }
Exemplo n.º 4
0
        public RPCCommand(Jeedom jee, string method)
        {
            _method = method;
            _vars   = new Dictionary <string, object> ();

            Init(jee);
        }
Exemplo n.º 5
0
        public EqLogics(Jeedom jee, JeedomEntities entities)
        {
            _jee      = jee;
            _entities = entities;

            Load();
        }
Exemplo n.º 6
0
        private void Init(Jeedom jee)
        {
            _jeedom = jee;
            _response = string.Empty;
            _error = string.Empty;

            // Our RPC command "object"
            Dictionary<string, object> request = new Dictionary<string, object>()
            {
                { "jsonrpc", "2.0" },
                { "id", new Random().Next(1,9999) },
                { "method", _method },
                { "params", _vars }
            };

            // We inject the API key in the command parameters
            Dictionary<string, object> par = (Dictionary<string, object>)request["params"];
            par.Add("apikey", _jeedom._api_key);

            // Our RPC command is encapsulated by JSON...
            _RPCcommand = new Dictionary<string, object>()
            {
                { "request", JsonConvert.SerializeObject(request) }
            };
        }
Exemplo n.º 7
0
        public RPCCommand(Jeedom jee, string method, Dictionary<string, object> vars)
        {
            _method = method;
            _vars = vars;

            Init(jee);
        }
Exemplo n.º 8
0
        public RPCCommand(Jeedom jee, string method)
        {
            _method = method;
            _vars = new Dictionary<string, object> ();

            Init(jee);
        }
Exemplo n.º 9
0
        public HTTPQuery(Jeedom jee, Dictionary<string, object> args)
        {
            _args = args;
            _jeedom = jee;

            // Formatting the POST request using HttpBuildQueryHelper
            // Thanks Roland Mai !!!
            _query = HttpBuildQueryHelper.FormatDictionary(args);
        }
Exemplo n.º 10
0
        public HTTPQuery(Jeedom jee, Dictionary <string, object> args)
        {
            _args   = args;
            _jeedom = jee;

            // Formatting the POST request using HttpBuildQueryHelper
            // Thanks Roland Mai !!!
            _query = HttpBuildQueryHelper.FormatDictionary(args);
        }
Exemplo n.º 11
0
        private void Init()
        {
            if (check_Custom_Port.Checked && check_Additionnal_Path.Checked)
            {
                jee = new Jeedom(text_Host.Text, text_Additionnal_Path.Text, int.Parse(text_Port.Text), text_API_Key.Text, check_Use_SSL.Checked, check_Bypass_SSL.Checked);
            }
            else if (check_Custom_Port.Checked)
            {
                jee = new Jeedom(text_Host.Text, int.Parse(text_Port.Text), text_API_Key.Text, check_Use_SSL.Checked, check_Bypass_SSL.Checked);
            }
            else if (check_Additionnal_Path.Checked)
            {
                jee = new Jeedom(text_Host.Text, text_Additionnal_Path.Text, text_API_Key.Text, check_Use_SSL.Checked, check_Bypass_SSL.Checked);
            }
            else
            {
                jee = new Jeedom(text_Host.Text, text_API_Key.Text, check_Use_SSL.Checked, check_Bypass_SSL.Checked);
            }

            jee.OnResponse += Jee_OnResponse;

            jee.Load();
        }
Exemplo n.º 12
0
        public Scenarios(Jeedom jee)
        {
            _jee = jee;

            Load();
        }
Exemplo n.º 13
0
        public Objects(Jeedom jee)
        {
            _jee = jee;

            Load();
        }
Exemplo n.º 14
0
        public Plugins(Jeedom jee)
        {
            _jee = jee;

            Load();
        }
Exemplo n.º 15
0
        public Messages(Jeedom jee)
        {
            _jee = jee;

            Load();
        }