def test_to_knx_error_operation_mode(self):
     """Test to_knx function with wrong parameter."""
     xknx = XKNX()
     remote_value = RemoteValueClimateMode(
         xknx,
         climate_mode_type=RemoteValueClimateMode.ClimateModeType.HVAC_MODE)
     with self.assertRaises(ConversionError):
         remote_value.to_knx(256)
     with self.assertRaises(ConversionError):
         remote_value.to_knx("256")
 def test_to_knx_operation_mode(self):
     """Test to_knx function with normal operation."""
     xknx = XKNX()
     remote_value = RemoteValueClimateMode(
         xknx,
         climate_mode_type=RemoteValueClimateMode.ClimateModeType.HVAC_MODE)
     self.assertEqual(remote_value.to_knx(HVACOperationMode.COMFORT),
                      DPTArray((0x01, )))