Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 11 commits into from
Jan 15, 2023

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Jan 11, 2023

dev blog post and updates to the dev docs.

While its labeled as a breaking change, if the developer does nothing they will get the behavior before this PR where the remote bluetooth adapter may not be available before the integration is loaded which makes the impact minimal.

Breaking change

This breaking change is for developers only.

Before this change we could try to connect to a bluetooth device that was only reachable by a remote adapter before the remote adapter was setup. We need to wait until all the remote scanners have a chance to setup before trying to connect bluetooth devices to avoid connecting via the wrong adapter (one that will be very slow and slow down startup) or fail because the adapter that can see the device isn't connected yet.

Integrations that provide a bluetooth adapter should add bluetooth as a dependency

Integration that need to use a bluetooth adapter should add bluetooth_adapters as a dependency which ensures all supported remote adapters have a chance to be connected before loading integrations that need them

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

…need them

Integrations that provide a bluetooth adapter should add `bluetooth`
as a dependency

Integration that need to use a bluetooth adapter should add `bluetooth_adapters`
as a dependency

Integrations should now depend on the bluetooth_adapters integration
which ensures all supported remote adapters have a chance to be connected
before loading integrations that need them
@bdraco
Copy link
Member Author

bdraco commented Jan 13, 2023

No changes, only resolving conflicts

@bdraco
Copy link
Member Author

bdraco commented Jan 15, 2023

thanks

@bdraco
Copy link
Member Author

bdraco commented Jan 15, 2023

retest is good

@bdraco bdraco merged commit 65ca62c into home-assistant:dev Jan 15, 2023
@bdraco bdraco deleted the remote_adapters branch January 15, 2023 23:17
@github-actions github-actions bot locked and limited conversation to collaborators Jan 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants