diff --git a/bimmer_connected/api/utils.py b/bimmer_connected/api/utils.py index b8148fa1..2b8f9780 100644 --- a/bimmer_connected/api/utils.py +++ b/bimmer_connected/api/utils.py @@ -23,7 +23,7 @@ from bimmer_connected.models import AnonymizedResponse, MyBMWAPIError, MyBMWAuthError, MyBMWQuotaError UNICODE_CHARACTER_SET = string.ascii_letters + string.digits + "-._~" -RE_VIN = re.compile(r"(?PWB[a-zA-Z0-9]{15})") +RE_VIN = re.compile(r"(?P\b[(A-H|J-N|P|R-Z|0-9)]{17}\b)") ANONYMIZED_VINS: Dict[str, str] = {} diff --git a/bimmer_connected/tests/test_api.py b/bimmer_connected/tests/test_api.py index 1a4c98a3..043f3050 100644 --- a/bimmer_connected/tests/test_api.py +++ b/bimmer_connected/tests/test_api.py @@ -47,7 +47,7 @@ def test_anonymize_data(): "licensePlate": "secret", "public": "public_data", "a_list": [ - {"vin": "WBA000000SECRET01"}, + {"vin": "4US000000SECRET01"}, { "lon": 666, "public": "more_public_data",