public void VerifyInsteonNetworkTest() { network = new InsteonNetwork(); var connected = network.TryConnect(); Assert.IsTrue(connected); Assert.IsTrue(network.VerifyConnection()); network.Close(); }
public void SimpleConnectAnySerialPortTest() { network = new InsteonNetwork(); var connected = network.TryConnect(); Assert.IsTrue(connected); Assert.AreEqual(network.Connection.Address.Value, InsteonAddress.Parse(ConfigurationManager.AppSettings["plmIdentityTest"]).Value); network.Close(); }
public void TearDown() { if (network != null && network.IsConnected) { network.Close(); } network = null; }
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 void GetLinksTest() { network = new InsteonNetwork(); var connected = network.TryConnect(); Assert.IsTrue(connected); var links = network.Controller.GetDeviceLinkRecords(); foreach (var link in links) { Console.WriteLine(link.Address + ":" + link.RecordType); } Assert.IsNotEmpty(links); network.Close(); }
public void GetLinkIdentityTest() { network = new InsteonNetwork(); var connected = network.TryConnect(); Assert.IsTrue(connected); var links = network.Controller.GetDeviceLinkRecords(); Assert.IsNotEmpty(links); var insteonAddresses = links.Select(l => l.Address).Distinct(); foreach (var insteonAddress in insteonAddresses) { if (network.Devices.ContainsKey(insteonAddress)) { continue; } InsteonIdentity?id; if (network.Controller.TryGetLinkIdentity(insteonAddress, out id)) { if (id != null) { var d = network.Devices.Add(insteonAddress, id.Value); } } else { Console.WriteLine("Possibly a battery powered device."); } } network.Close(); }