Expose async_scanner_devices_by_address from the bluetooth api#83733
Conversation
… from the bluetooth api.
|
Hi dbuezas It seems you haven't yet signed a CLA. Please do so here. Once you do that we will be able to review and accept this pull request. Thanks! |
|
Hey there @bdraco, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
|
Hi dbuezas It seems you haven't yet signed a CLA. Please do so here. Once you do that we will be able to review and accept this pull request. Thanks! |
|
We will need docs for this as well https://developers.home-assistant.io/docs/bluetooth?_highlight=blue and a test |
|
I'll hold this until I find out if this is indeed useful to connect to a specific adapter. I thought this was working, but after inspection, I see that the path of device I pass to establish_connection and client._backend._device_path differ. This seems to be because both |
Co-authored-by: J. Nick Koston <nick@koston.org>
… bluetooth.md Goes together with home-assistant/core#83733
|
I added the docs, but I'm clueless regarding how to add the tests and it would take me more time than I have at hand to find figure out all the details. |
|
@dbuezas Do you still need this exposed given the local adapter connection management is now built-in? |
|
@bdraco yes, or a way to feed back that there were communication problems. In my use case connection may succeed, but communication can still fail due to pairing issues with a specific adapter. |
…advertisement_data_by_address
…_address -> async_scanner_devices_by_address and wrap up the result in a dataclass
|
Since we are exposing this as a public api, I'm going to rename |
|
I added the tests for you. I also renamed it and wrapped it up in a dataclass to make it more developer friendly since we are going to expose this in a public API. That probably means some |
|
That's awesome! Thank you! |
|
I'm going to get #85448 merged and than fix conflicts here. |
…advertisement_data_by_address
|
I think this is all good to go now. I need to do some functional testing just to be sure (the tests should cover this 100% though) |
|
Thank you for this! |
|
I think I screwed up the merge conflict here or on my integration branch |
|
It was just wrong on my integration branch. But I tweaked it to avoid a |
…advertisement_data_by_address
…assistant#83733) Co-authored-by: J. Nick Koston <nick@koston.org> fixes undefined
…assistant#83733) Co-authored-by: J. Nick Koston <nick@koston.org> fixes undefined



Proposed change
Exposes
async_scanner_devices_by_addressin the bluetooth api so that integrations can decide to use a different bluetooth adapter if they wish so.This is useful in two cases:
Both are arguably best solved by fully implementing extra functionality in the core, but since those are non-trivial tasks, this may serve to "unbreak" integrations in the meantime
Type of change
Additional information
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.To help with the load of incoming pull requests: