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)), RemoteValueSwitch.Value.OFF) self.assertEqual(remote_value.from_knx(DPTBinary(0)), RemoteValueSwitch.Value.ON)
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(self): """Test from_knx function with normal operation.""" xknx = XKNX(loop=self.loop) remote_value = RemoteValueSwitch(xknx) self.assertEqual(remote_value.from_knx(DPTBinary(True)), True) self.assertEqual(remote_value.from_knx(DPTBinary(0)), False)