Validate length of rfxtrx identifier (#85352)

This commit is contained in:
Joakim Plate 2023-01-07 10:52:46 +01:00 committed by GitHub
parent dfca3c2448
commit 7f2b7340b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -441,7 +441,7 @@ def get_device_tuple_from_identifiers(
identifiers: set[tuple[str, str]]
) -> DeviceTuple | None:
"""Calculate the device tuple from a device entry."""
identifier = next((x for x in identifiers if x[0] == DOMAIN), None)
identifier = next((x for x in identifiers if x[0] == DOMAIN and len(x) == 4), None)
if not identifier:
return None
# work around legacy identifier, being a multi tuple value