Пример #1
0
 def test_from_knx_invert(self):
     """Test from_knx function with normal operation."""
     xknx = XKNX()
     remote_value = RemoteValueUpDown(xknx, invert=True)
     assert remote_value.from_knx(
         DPTBinary(0)) == RemoteValueUpDown.Direction.DOWN
     assert remote_value.from_knx(
         DPTBinary(1)) == RemoteValueUpDown.Direction.UP
Пример #2
0
 def test_from_knx(self):
     """Test from_knx function with normal operation."""
     xknx = XKNX()
     remote_value = RemoteValueUpDown(xknx)
     self.assertEqual(remote_value.from_knx(DPTBinary(0)),
                      RemoteValueUpDown.Direction.UP)
     self.assertEqual(remote_value.from_knx(DPTBinary(1)),
                      RemoteValueUpDown.Direction.DOWN)