def test_from_knx_invert(self): """Test from_knx function with normal operation.""" xknx = XKNX(loop=self.loop) remote_value = RemoteValueSwitch(xknx, invert=True) self.assertEqual(remote_value.from_knx(DPTBinary(1)), False) self.assertEqual(remote_value.from_knx(DPTBinary(0)), True)
def test_from_knx_invert(self): """Test from_knx function with normal operation.""" xknx = XKNX() remote_value = RemoteValueSwitch(xknx, invert=True) assert remote_value.from_knx(DPTBinary(1)) is False assert remote_value.from_knx(DPTBinary(0)) is True
def test_from_knx(self): """Test from_knx function with normal operation.""" xknx = XKNX() remote_value = RemoteValueSwitch(xknx) self.assertEqual(remote_value.from_knx(DPTBinary(True)), True) self.assertEqual(remote_value.from_knx(DPTBinary(0)), False)