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

backends/service: normalize UUIDs in get_characteristic() #1551

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Fixed
* Fixed rare unhandled exception when scanning on macOS when using ``use_bdaddr``. Fixes #1523.
* Fixed scanning silently failing on Windows when Bluetooth is off. Fixes #1535.
* Fixed using wrong value for ``tx_power`` in Android backend. Fixes #1532.
* Fixed 4-character UUIDs not working on ``BleakClient.*_gatt_char`` methods. Fixes #1498.

`0.21.1`_ (2023-09-08)
======================
Expand Down
4 changes: 3 additions & 1 deletion bleak/backends/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,12 @@ def get_characteristic(
if isinstance(specifier, int):
return self.characteristics.get(specifier)

uuid = normalize_uuid_str(str(specifier))

# Assume uuid usage.
x = list(
filter(
lambda x: x.uuid == str(specifier).lower(),
lambda x: x.uuid == uuid,
self.characteristics.values(),
)
)
Expand Down
Loading