public void SimpleConnectKnownSerialPortTest() { InsteonConnection connection; Assert.IsTrue(InsteonConnection.TryParse(insteonSource, out connection)); network = new InsteonNetwork(); var connected = network.TryConnect(connection); Assert.IsTrue(connected); Assert.AreEqual(connection.Address.Value, InsteonAddress.Parse(ConfigurationManager.AppSettings["plmIdentityTest"]).Value); network.Close(); }
public InsteonManager(string insteonSource) { logger.Debug("Creating insteon manager"); InsteonConnection iConnection; if (InsteonConnection.TryParse(insteonSource, out iConnection)) { logger.DebugFormat("Parsed InsteonConnection to {0}", iConnection.ToString()); Connection = iConnection; } else { throw new Exception("Could not create Insteon Connection type from " + insteonSource); } Network = new InsteonNetwork { AutoAdd = true }; }