-
Notifications
You must be signed in to change notification settings - Fork 300
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
programmatically accept pairing request in python without dialog interaction #827
Comments
In Windows, the pairing is already designed to be "Just Works" without any user interaction: A pairing request is sent and the method in the link above should just accept the pairing without any further processing needed. If a dialog is brought up, then that is a change in how Windows handles pairing. I did not get a dialog when I paired the last time. From the Microsoft UWP docs concering the ConfirmOnly solution:
For integration tests, just monkeypatch the async def mock_pair_success(client, protection_level: int = None, **kwargs) -> bool:
return True
client.pair = mock_pair_success You will never be able to test pairing without performing the actual pairing with Bleak, since it uses the OS native BLE APIs. You could possible monkeypatch the CustomPairing class from the |
using Windows version 10.0.19042 Build 19042. it's not latest and greatest
I don't want to prevent pairing at all I just want to do it in a way that I don't need to process any user dialog. just processing it in code or automatically if possible. should just works (like you describe for windows above) also work in a linux environment? |
This is not technically possible on macOS. For Windows and Linux, there is a pull request open for this, but it has been stalled. #640 |
This is a problem for my team's work in MacOS 12+ right now. :( |
bluetoothctl -v
) in case of Linux: 5.50Description
Looking for a way to accept pairing request during integration tests without dialog action in windows. also want to understand what would be needed to do the same in a linux environment
What I Did
used BleakClient.pair(). works if I wait and confirm pairing in dialog. but I'm looking for a way to do that by code.
The text was updated successfully, but these errors were encountered: