-
Notifications
You must be signed in to change notification settings - Fork 304
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
Release/0.18.0 #1027
Merged
Merged
Release/0.18.0 #1027
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This changes all remaining library files to use relative imports. Some files are already doing this since we have circular imports in a few places. This also sorts other imports while we are touching this.
Signatures of methods haven't changed since 3.0 for use cases in bleak. Relaxing of the dependency will allow using prebuilt version of async-timeout on OpenWrt 21.03 which has version 3.0.1
use relative imports
0 is a valid value for tx_power, so we can't use a falsy check and need to check for None instead.
This allows us to put all of the documentation, including platform- specific quirks, for BleakScanner and BleakClient in one place. Docs for these classes are move to new sub-pages of the API docs page and the backend docs are moved to the backend pages of the docs. It will also allow us to eventually eliminate quite a bit of duplicated code from the backends by moving it to these shared classes. Several methods that provided duplicate functionality have been deprecated (previously they were required because of backend implementation details but can now be safely removed from the top-level classes).
Much of the information on this page is outdated. The information that is still relevant is now covered on the new dedicated BleakScanner class page.
This can be useful for custom backends and testing.
Since we were importing `bleak` in conf.py, it required some runtime dependencies to be installed. We can avoid this by just reading the version from the pyproject.toml file instead.
0150ef3 broke implicit scanning because some methods were moved from the backends to the new top-level class. This fixes the issue by using the new backends kwarg of the scanner to pass the matching scanner backend to the client. This also revealed a bug in the backend kwarg implementation that is now fixed.
* Repeated code for BleakClient.start_notify() is moved from the backends to the top-level BleakClient class. * self._notification_callbacks is removed from BaseBleakClient since it is not used in all backends. * A new (internal) NotifyCallback type alias is added so we don't have to repeat the Callable with args multiple times. * BaseBleakClient.start_notify() arg types are changed. The battery workaround in the BlueZ backend is removed since the refactored top-level code will fail before calling the backend code. Hopefully this should mostly go unnoticed since it will only affect BlueZ < 5.55 and most users are reporting at least that version on GitHub.
This is a breaking change that changes the first argument of the notification callback from the handle to the BleakGATTCharacteristic object. This has been a commonly reported problem by users (so much so it is in our troubleshooting guide which can now be removed) and #759 has received positive feedback for the breaking change. It is likely that most users don't use the first argument anyway, so in those cases, this won't actually be a breaking change. Fixes: #759
This was missed in #982 since BaseBleakClient didn't have an abstract property for this. This adds the base abstract property to the backends, fixes the missing property in BleakClient client and adds it to the documentation.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changed
async-timeout
dependency version to support different installations. Merged Relax async-timeout version #1009.BleakClient.unpair()
in WinRT backend can be called without being connected first. Merged allow unpair without being connected on WinRT backend #1012.BleakScanner
andBleakClient
are now concrete classes. Fixes Want to use BleakClient within bleak package #582.BleakScanner.register_detection_callback()
.BleakScanner.set_scanning_filter()
.BleakClient.set_disconnected_callback()
.BleakClient.get_services()
.BleakClient.start_notify()
.int
toBleakGattCharacteristic
. Fixes proposed breaking change: change handle argument type in notification callbacks #759.Fixed
tx_power
not included inAdvertisementData.__repr__
when 0. Merged backends/scanner: fix tx_power missing in __repr__ when 0 #1017.