示例#1
0
 public void SetHost(HomeGenieService hg, int programId)
 {
     homegenie        = hg;
     netHelper        = new NetHelper(homegenie);
     programHelper    = new ProgramHelper(homegenie, programId);
     eventsHelper     = new EventsHelper(homegenie, programId);
     serialPortHelper = new SerialPortHelper();
     tcpClientHelper  = new TcpClientHelper();
     schedulerHelper  = new SchedulerHelper(homegenie);
 }
示例#2
0
 public void SetHost(HomeGenieService hg, int programId)
 {
     homegenie = hg;
     netHelper = new NetHelper(homegenie);
     programHelper = new ProgramHelper(homegenie, programId);
     eventsHelper = new EventsHelper(homegenie, programId);
     serialPortHelper = new SerialPortHelper();
     tcpClientHelper = new TcpClientHelper();
     schedulerHelper = new SchedulerHelper(homegenie);
 }
示例#3
0
        /// <summary>
        /// Returns a reference to the ProgramHelper of a program.
        /// </summary>
        /// <returns>ProgramHelper.</returns>
        /// <param name="programName">Program name.</param>
        public ProgramHelper WithName(string programName)
        {
            var           program       = homegenie.ProgramEngine.Programs.Find(p => p.Name.ToLower() == programName.ToLower());
            ProgramHelper programHelper = null;

            if (program != null)
            {
                programHelper = new ProgramHelper(homegenie, program.Address);
            }
            return(programHelper);
        }
示例#4
0
        /// <summary>
        /// Returns a reference to the ProgramHelper of a program.
        /// </summary>
        /// <returns>ProgramHelper.</returns>
        /// <param name="programAddress">Program address (id).</param>
        public ProgramHelper WithAddress(int programAddress)
        {
            var           program       = homegenie.ProgramEngine.Programs.Find(p => p.Address == programAddress);
            ProgramHelper programHelper = null;

            if (program != null)
            {
                programHelper = new ProgramHelper(homegenie, program.Address);
            }
            return(programHelper);
        }
示例#5
0
        public ProgramHelper WithName(string programname)
        {
            ProgramBlock  pb = _homegenie.ProgramEngine.Programs.Find(p => p.Name.ToLower() == programname.ToLower());
            ProgramHelper ph = null;

            if (pb != null)
            {
                ph = new ProgramHelper(_homegenie, pb.Address);
            }
            return(ph);
        }
示例#6
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);
 }
示例#7
0
 /// <summary>
 /// Returns a reference to the ProgramHelper of a program.
 /// </summary>
 /// <returns>ProgramHelper.</returns>
 /// <param name="programName">Program name.</param>
 public ProgramHelper WithName(string programName)
 {
     var program = homegenie.ProgramManager.Programs.Find(p => p.Name.ToLower() == programName.ToLower());
     ProgramHelper programHelper = null;
     if (program != null)
     {
         programHelper = new ProgramHelper(homegenie, program.Address);
     }
     return programHelper;
 }
示例#8
0
 /// <summary>
 /// Returns a reference to the ProgramHelper of a program.
 /// </summary>
 /// <returns>ProgramHelper.</returns>
 /// <param name="programAddress">Program address (id).</param>
 public ProgramHelper WithAddress(int programAddress)
 {
     var program = homegenie.ProgramManager.Programs.Find(p => p.Address == programAddress);
     ProgramHelper programHelper = null;
     if (program != null)
     {
         programHelper = new ProgramHelper(homegenie, program.Address);
     }
     return programHelper;
 }