Ejemplo n.º 1
0
 def test_to_process_error(self):
     """Test process errornous telegram."""
     xknx = XKNX(loop=self.loop)
     remote_value = RemoteValueSwitch(xknx,
                                      group_address=GroupAddress("1/2/3"))
     with self.assertRaises(CouldNotParseTelegram):
         telegram = Telegram(group_address=GroupAddress("1/2/3"),
                             payload=DPTArray((0x01)))
         self.loop.run_until_complete(
             asyncio.Task(remote_value.process(telegram)))
     with self.assertRaises(CouldNotParseTelegram):
         telegram = Telegram(group_address=GroupAddress("1/2/3"),
                             payload=DPTBinary(3))
         self.loop.run_until_complete(
             asyncio.Task(remote_value.process(telegram)))
         # pylint: disable=pointless-statement
         remote_value.value
Ejemplo n.º 2
0
 def test_to_process_error(self):
     """Test process errornous telegram."""
     xknx = XKNX(loop=self.loop)
     remote_value = RemoteValueSwitch(
         xknx,
         group_address=GroupAddress("1/2/3"))
     with self.assertRaises(CouldNotParseTelegram):
         telegram = Telegram(
             group_address=GroupAddress("1/2/3"),
             payload=DPTArray((0x01)))
         self.loop.run_until_complete(asyncio.Task(remote_value.process(telegram)))
     with self.assertRaises(CouldNotParseTelegram):
         telegram = Telegram(
             group_address=GroupAddress("1/2/3"),
             payload=DPTBinary(3))
         self.loop.run_until_complete(asyncio.Task(remote_value.process(telegram)))
         # pylint: disable=pointless-statement
         remote_value.value
Ejemplo n.º 3
0
 def test_process_off(self):
     """Test process OFF telegram."""
     xknx = XKNX(loop=self.loop)
     remote_value = RemoteValueSwitch(xknx,
                                      group_address=GroupAddress("1/2/3"))
     telegram = Telegram(group_address=GroupAddress("1/2/3"),
                         payload=DPTBinary(0))
     self.assertEqual(remote_value.value, None)
     self.loop.run_until_complete(
         asyncio.Task(remote_value.process(telegram)))
     self.assertIsNotNone(remote_value.payload)
     self.assertEqual(remote_value.value, False)
Ejemplo n.º 4
0
 def test_process_off(self):
     """Test process OFF telegram."""
     xknx = XKNX(loop=self.loop)
     remote_value = RemoteValueSwitch(
         xknx,
         group_address=GroupAddress("1/2/3"))
     telegram = Telegram(
         group_address=GroupAddress("1/2/3"),
         payload=DPTBinary(0))
     self.assertEqual(remote_value.value, None)
     self.loop.run_until_complete(asyncio.Task(remote_value.process(telegram)))
     self.assertIsNotNone(remote_value.payload)
     self.assertEqual(remote_value.value, False)