Exemple #1
0
 def test_0_pyhomematic_noinit(self):
     LOG.info("TestPyhomematicBase.test_0_pyhomematic_noinit")
     client = HMConnection(interface_id=DEFAULT_INTERFACE_CLIENT,
                           autostart=False,
                           remotes={
                               DEFAULT_REMOTE: {
                                   "ip": DEFAULT_IP,
                                   "port": self.localport,
                                   "connect": False
                               }
                           })
     client.start()
     time.sleep(STARTUP_DELAY)
     servicemessages = client.getServiceMessages(DEFAULT_REMOTE)
     self.assertEqual(len(servicemessages), 1)
     self.assertEqual(servicemessages[0][0], 'VCU0000001:1')
     client.stop()
Exemple #2
0
 def test_1_pyhomematic_init(self):
     LOG.info("TestPyhomematicBase.test_1_pyhomematic_init")
     client = HMConnection(interface_id=DEFAULT_INTERFACE_CLIENT,
                           autostart=False,
                           remotes={
                               DEFAULT_REMOTE: {
                                   "ip": DEFAULT_IP,
                                   "port": self.localport,
                                   "connect": True
                               }
                           })
     client.start()
     time.sleep(STARTUP_DELAY)
     servicemessages = client.getServiceMessages(DEFAULT_REMOTE)
     self.assertEqual(len(servicemessages), 1)
     self.assertEqual(servicemessages[0][0], 'VCU0000001:1')
     self.assertIsInstance(client.devices, dict)
     devices = client.devices.get(DEFAULT_REMOTE)
     self.assertIsInstance(devices, dict)
     self.assertGreater(len(devices.keys()), 0)
     client.stop()