Skip to content

BLE transport: pass WinRT options to BleakClient#98

Merged
JPHutchins merged 1 commit intointercreate:mainfrom
gudnimg:winrt-ble-arg
Feb 5, 2026
Merged

BLE transport: pass WinRT options to BleakClient#98
JPHutchins merged 1 commit intointercreate:mainfrom
gudnimg:winrt-ble-arg

Conversation

@gudnimg
Copy link
Contributor

@gudnimg gudnimg commented Feb 5, 2026

Add an optional winrt argument to SMPBLETransport, store it, and forward it to BleakClient during connect. The argument is ignored on non-Windows platforms.

Fixes #96

@gudnimg
Copy link
Contributor Author

gudnimg commented Feb 5, 2026

I was a bit unsure about using WinRTClientArgs https://github.com/hbldh/bleak/blob/cc88bc170512e23674ddd24ffecd09d69f68bb6e/bleak/args/winrt.py#L10 for typing as its possible its not available on all platforms. So for now I just skipped type annotations.

I tested the change on Windows 11, and it works well :)

EDIT: I added type annotation since CI is forcing it.

@gudnimg gudnimg force-pushed the winrt-ble-arg branch 2 times, most recently from 0d056fa to 1cdf8b9 Compare February 5, 2026 16:04
Add an optional `winrt` argument to `SMPBLETransport`, store it, and forward it
to `BleakClient` during connect. The argument is ignored on non-Windows platforms.
@JPHutchins
Copy link
Collaborator

Thanks!

@JPHutchins JPHutchins self-requested a review February 5, 2026 16:18
@JPHutchins JPHutchins merged commit 0770bc9 into intercreate:main Feb 5, 2026
21 checks passed
@gudnimg gudnimg deleted the winrt-ble-arg branch February 5, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows: Add support for setting use_cached_services to False in connect method

2 participants