Add early return check to passive Bluetooth entities listener (#102435)

This commit is contained in:
J. Nick Koston 2023-10-21 10:06:39 -10:00 committed by GitHub
parent f626f3bc1e
commit 89f9d64bf5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -470,7 +470,7 @@ class PassiveBluetoothDataProcessor(Generic[_T]):
data: PassiveBluetoothDataUpdate[_T] | None,
) -> None:
"""Listen for new entities."""
if data is None:
if data is None or created.issuperset(data.entity_descriptions):
return
entities: list[PassiveBluetoothProcessorEntity] = []
for entity_key, description in data.entity_descriptions.items():