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