def test_to_process_error_operation_mode(self): """Test process errornous telegram.""" xknx = XKNX() remote_value = RemoteValueClimateMode( xknx, group_address=GroupAddress("1/2/3"), climate_mode_type=RemoteValueClimateMode.ClimateModeType.HVAC_MODE, ) with self.assertRaises(CouldNotParseTelegram): telegram = Telegram( destination_address=GroupAddress("1/2/3"), payload=GroupValueWrite(DPTBinary(1)), ) self.loop.run_until_complete(remote_value.process(telegram)) with self.assertRaises(CouldNotParseTelegram): telegram = Telegram( destination_address=GroupAddress("1/2/3"), payload=GroupValueWrite( DPTArray( ( 0x64, 0x65, ) ) ), ) self.loop.run_until_complete(remote_value.process(telegram))
def test_process_operation_mode(self): """Test process telegram.""" xknx = XKNX() remote_value = RemoteValueClimateMode( xknx, group_address=GroupAddress("1/2/3"), climate_mode_type=RemoteValueClimateMode.ClimateModeType.HVAC_MODE, ) telegram = Telegram(group_address=GroupAddress("1/2/3"), payload=DPTArray((0x00, ))) self.loop.run_until_complete(remote_value.process(telegram)) self.assertEqual(remote_value.value, HVACOperationMode.AUTO)