def test_is_off(self): """Test is_on() and is_off() of a BinarySensor with state 'off'.""" xknx = XKNX(loop=self.loop) binaryinput = BinarySensor(xknx, 'TestInput', '1/2/3') # pylint: disable=protected-access self.loop.run_until_complete(asyncio.Task(binaryinput._set_internal_state(BinarySensorState.OFF))) self.assertFalse(binaryinput.is_on()) self.assertTrue(binaryinput.is_off())
def test_is_off(self): """Test is_on() and is_off() of a BinarySensor with state 'off'.""" xknx = XKNX() binaryinput = BinarySensor(xknx, "TestInput", "1/2/3") # pylint: disable=protected-access self.loop.run_until_complete(binaryinput._set_internal_state(False)) self.assertFalse(binaryinput.is_on()) self.assertTrue(binaryinput.is_off())