Ensure remote bluetooth adapters are loaded before integrations that need them (#85723)

This commit is contained in:
J. Nick Koston 2023-01-15 13:17:17 -10:00 committed by GitHub
parent cd31624768
commit 65ca62c991
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 103 additions and 31 deletions

View file

@ -163,6 +163,12 @@ def calc_allowed_references(integration: Integration) -> set[str]:
| set(manifest.get("dependencies", []))
| set(manifest.get("after_dependencies", []))
)
# bluetooth_adapters is a wrapper to ensure
# that all the integrations that provide bluetooth
# adapters are setup before loading integrations
# that use them.
if "bluetooth_adapters" in allowed_references:
allowed_references.add("bluetooth")
# Discovery requirements are ok if referenced in manifest
for check_domain, to_check in DISCOVERY_INTEGRATIONS.items():