Esempio n. 1
0
 public void SetHost(HomeGenieService hg, int programId)
 {
     hgService  = hg;
     Net        = new NetHelper(hgService.Parameters, hgService.GetHttpServicePort());
     Program    = new ProgramHelper(hgService, programId);
     When       = new EventsHelper(hgService, programId);
     SerialPort = new SerialPortHelper();
     TcpClient  = new TcpClientHelper();
     UdpClient  = new UdpClientHelper();
     MqttClient = new MqttClientHelper();
     KnxClient  = new KnxClientHelper();
     Scheduler  = new SchedulerHelper(hgService);
 }
Esempio n. 2
0
 public void SetHost(HomeGenieService hg, SchedulerItem item)
 {
     homegenie     = hg;
     schedulerItem = item;
     Reset();
     netHelper        = new NetHelper(homegenie.Parameters, homegenie.GetHttpServicePort());
     serialPortHelper = new SerialPortHelper();
     tcpClientHelper  = new TcpClientHelper();
     udpClientHelper  = new UdpClientHelper();
     mqttClientHelper = new MqttClientHelper();
     knxClientHelper  = new KnxClientHelper();
     schedulerHelper  = new SchedulerHelper(homegenie);
     programHelper    = new ProgramHelperBase(homegenie);
 }
Esempio n. 3
0
        public NetHelper SignalModuleEvent(string hgaddress, ModuleHelper m, ModuleParameter p)
        {
            string eventrouteurl = "http://" + hgaddress + "/api/HomeAutomation.HomeGenie/Interconnection/Events.Push/" + _homegenie.GetHttpServicePort();

            // propagate event to remote hg endpoint
            this.WebService(eventrouteurl)
            .Put(JsonConvert.SerializeObject(new ModuleEvent(m.SelectedModules[0], p)))
            .CallAsync();
            return(this);
        }