Exemple #1
0
 def test_07_knxwrongrangediscover(self):
     with self.assertRaises(BOFProgrammingError):
         devices = knx.discover("192.168.1.1/61")
Exemple #2
0
 def test_05_knxwrongdiscover2(self):
     with self.assertRaises(BOFProgrammingError):
         device = knx.discover("hi")
Exemple #3
0
 def test_06_knxwrongmultidiscover(self):
     with self.assertRaises(BOFProgrammingError):
         devices = knx.discover("192.168.1.1,hi")
Exemple #4
0
 def test_04_knxwrongdiscover(self):
     device = knx.discover("192.168.1.1")
     self.assertEqual(device, None)
Exemple #5
0
 def test_03_knxrangediscover(self):
     devices = knx.discover("192.168.1.0/24")
     self.assertTrue(isinstance(devices, list))
     self.assertTrue(isinstance(devices[0], knx.KnxDevice))
     self.assertEqual(devices[0].address, BOIBOITE)
     self.assertEqual(devices[0].port, 3671)
Exemple #6
0
 def test_02_knxmultidiscover(self):
     devices = knx.discover("192.168.1.232,192.168.1.242")
     self.assertTrue(isinstance(devices, list))
     self.assertTrue(isinstance(devices[0], knx.KnxDevice))
Exemple #7
0
 def test_01_knxdiscover(self):
     device = knx.discover(BOIBOITE)
     self.assertTrue(isinstance(device, knx.KnxDevice))
Exemple #8
0
from sys import path, argv
path.append('../')

from bof import knx, BOFNetworkError

if len(argv) < 2:
    print("Usage: python {0} IP_RANGE".format(argv[0]))
else:
    devices = knx.discover(argv[1])
    if isinstance(devices, knx.KnxDevice):
        print(devices)
    else:
        for device in devices:
            print(device)