示例#1
0
 def test_sync_angle(self):
     """Test sync function for cover with angle."""
     xknx = XKNX()
     cover = Cover(
         xknx,
         "TestCover",
         group_address_long="1/2/1",
         group_address_short="1/2/2",
         group_address_position_state="1/2/3",
         group_address_angle_state="1/2/4",
     )
     self.loop.run_until_complete(cover.sync())
     self.assertEqual(xknx.telegrams.qsize(), 2)
     telegram1 = xknx.telegrams.get_nowait()
     self.assertEqual(
         telegram1,
         Telegram(
             destination_address=GroupAddress("1/2/3"), payload=GroupValueRead()
         ),
     )
     telegram2 = xknx.telegrams.get_nowait()
     self.assertEqual(
         telegram2,
         Telegram(
             destination_address=GroupAddress("1/2/4"), payload=GroupValueRead()
         ),
     )
示例#2
0
 def test_sync(self):
     """Test sync function / sending group reads to KNX bus."""
     xknx = XKNX(loop=self.loop)
     cover = Cover(xknx,
                   'TestCover',
                   group_address_long='1/2/1',
                   group_address_short='1/2/2',
                   group_address_position='1/2/3')
     self.loop.run_until_complete(asyncio.Task(cover.sync(False)))
     self.assertEqual(xknx.telegrams.qsize(), 1)
     telegram1 = xknx.telegrams.get_nowait()
     self.assertEqual(telegram1,
                      Telegram(Address('1/2/3'), TelegramType.GROUP_READ))
示例#3
0
文件: cover_test.py 项目: phbaer/xknx
 def test_sync(self):
     """Test sync function / sending group reads to KNX bus."""
     xknx = XKNX(loop=self.loop)
     cover = Cover(
         xknx,
         'TestCover',
         group_address_long='1/2/1',
         group_address_short='1/2/2',
         group_address_position_state='1/2/3')
     self.loop.run_until_complete(asyncio.Task(cover.sync(False)))
     self.assertEqual(xknx.telegrams.qsize(), 1)
     telegram1 = xknx.telegrams.get_nowait()
     self.assertEqual(telegram1,
                      Telegram(GroupAddress('1/2/3'), TelegramType.GROUP_READ))
示例#4
0
 def test_sync_angle_state(self):
     """Test sync function with angle/explicit state."""
     xknx = XKNX(loop=self.loop)
     cover = Cover(xknx,
                   'TestCover',
                   group_address_long='1/2/1',
                   group_address_short='1/2/2',
                   group_address_angle='1/2/3',
                   group_address_angle_state='1/2/4')
     self.loop.run_until_complete(asyncio.Task(cover.sync(False)))
     self.assertEqual(xknx.telegrams.qsize(), 1)
     telegram1 = xknx.telegrams.get_nowait()
     self.assertEqual(telegram1,
                      Telegram(Address('1/2/4'), TelegramType.GROUP_READ))
示例#5
0
文件: cover_test.py 项目: phbaer/xknx
 def test_sync_angle_state(self):
     """Test sync function with angle/explicit state."""
     xknx = XKNX(loop=self.loop)
     cover = Cover(
         xknx,
         'TestCover',
         group_address_long='1/2/1',
         group_address_short='1/2/2',
         group_address_angle='1/2/3',
         group_address_angle_state='1/2/4')
     self.loop.run_until_complete(asyncio.Task(cover.sync(False)))
     self.assertEqual(xknx.telegrams.qsize(), 1)
     telegram1 = xknx.telegrams.get_nowait()
     self.assertEqual(telegram1,
                      Telegram(GroupAddress('1/2/4'), TelegramType.GROUP_READ))
示例#6
0
文件: cover_test.py 项目: jonppe/xknx
 def test_sync(self):
     """Test sync function / sending group reads to KNX bus."""
     xknx = XKNX()
     cover = Cover(
         xknx,
         "TestCover",
         group_address_long="1/2/1",
         group_address_short="1/2/2",
         group_address_position_state="1/2/3",
     )
     self.loop.run_until_complete(cover.sync())
     self.assertEqual(xknx.telegrams.qsize(), 1)
     telegram1 = xknx.telegrams.get_nowait()
     self.assertEqual(
         telegram1, Telegram(GroupAddress("1/2/3"),
                             TelegramType.GROUP_READ))
示例#7
0
文件: cover_test.py 项目: jonppe/xknx
 def test_sync_angle_state(self):
     """Test sync function with angle/explicit state."""
     xknx = XKNX()
     cover = Cover(
         xknx,
         "TestCover",
         group_address_long="1/2/1",
         group_address_short="1/2/2",
         group_address_angle="1/2/3",
         group_address_angle_state="1/2/4",
     )
     self.loop.run_until_complete(cover.sync())
     self.assertEqual(xknx.telegrams.qsize(), 1)
     telegram1 = xknx.telegrams.get_nowait()
     self.assertEqual(
         telegram1, Telegram(GroupAddress("1/2/4"),
                             TelegramType.GROUP_READ))