def test_set_on(self): """Test switching on a Light.""" xknx = XKNX(loop=self.loop) light = Light(xknx, name="TestLight", group_address_switch='1/2/3', group_address_brightness='1/2/5') self.loop.run_until_complete(asyncio.Task(light.set_on())) self.assertEqual(xknx.telegrams.qsize(), 1) telegram = xknx.telegrams.get_nowait() self.assertEqual(telegram, Telegram(Address('1/2/3'), payload=DPTBinary(1)))
def test_set_on(self): """Test switching on a Light.""" xknx = XKNX() light = Light( xknx, name="TestLight", group_address_switch="1/2/3", group_address_brightness="1/2/5", ) self.loop.run_until_complete(light.set_on()) self.assertEqual(xknx.telegrams.qsize(), 1) telegram = xknx.telegrams.get_nowait() self.assertEqual(telegram, Telegram(GroupAddress("1/2/3"), payload=DPTBinary(1)))