def test_set_off(self): """Test switching off 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_off())) self.assertEqual(xknx.telegrams.qsize(), 1) telegram = xknx.telegrams.get_nowait() self.assertEqual(telegram, Telegram(Address('1/2/3'), payload=DPTBinary(0)))
def test_set_off(self): """Test switching off 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_off()) self.assertEqual(xknx.telegrams.qsize(), 1) telegram = xknx.telegrams.get_nowait() self.assertEqual(telegram, Telegram(GroupAddress("1/2/3"), payload=DPTBinary(0)))