| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -105,11 +105,14 @@ def match_fw_to_car_fuzzy(live_fw_versions, match_brand=None, log=True, exclude= | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    return set() | 
					 | 
					 | 
					 | 
					    return set() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					def match_fw_to_car_exact(live_fw_versions, match_brand=None, log=True) -> Set[str]: | 
					 | 
					 | 
					 | 
					def match_fw_to_car_exact(live_fw_versions, match_brand=None, log=True, extra_fw_versions=None) -> Set[str]: | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  """Do an exact FW match. Returns all cars that match the given | 
					 | 
					 | 
					 | 
					  """Do an exact FW match. Returns all cars that match the given | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  FW versions for a list of "essential" ECUs. If an ECU is not considered | 
					 | 
					 | 
					 | 
					  FW versions for a list of "essential" ECUs. If an ECU is not considered | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  essential the FW version can be missing to get a fingerprint, but if it's present it | 
					 | 
					 | 
					 | 
					  essential the FW version can be missing to get a fingerprint, but if it's present it | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  needs to match the database.""" | 
					 | 
					 | 
					 | 
					  needs to match the database.""" | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  if extra_fw_versions is None: | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    extra_fw_versions = {} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  invalid = set() | 
					 | 
					 | 
					 | 
					  invalid = set() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  candidates = {c: f for c, f in FW_VERSIONS.items() if | 
					 | 
					 | 
					 | 
					  candidates = {c: f for c, f in FW_VERSIONS.items() if | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                is_brand(MODEL_TO_BRAND[c], match_brand)} | 
					 | 
					 | 
					 | 
					                is_brand(MODEL_TO_BRAND[c], match_brand)} | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -117,6 +120,7 @@ def match_fw_to_car_exact(live_fw_versions, match_brand=None, log=True) -> Set[s | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  for candidate, fws in candidates.items(): | 
					 | 
					 | 
					 | 
					  for candidate, fws in candidates.items(): | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    config = FW_QUERY_CONFIGS[MODEL_TO_BRAND[candidate]] | 
					 | 
					 | 
					 | 
					    config = FW_QUERY_CONFIGS[MODEL_TO_BRAND[candidate]] | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    for ecu, expected_versions in fws.items(): | 
					 | 
					 | 
					 | 
					    for ecu, expected_versions in fws.items(): | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      expected_versions = expected_versions + extra_fw_versions.get(candidate, {}).get(ecu, []) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      ecu_type = ecu[0] | 
					 | 
					 | 
					 | 
					      ecu_type = ecu[0] | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      addr = ecu[1:] | 
					 | 
					 | 
					 | 
					      addr = ecu[1:] | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |