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

Release/0.18.0 #1027

Merged
merged 19 commits into from
Sep 23, 2022
Merged

Release/0.18.0 #1027

merged 19 commits into from
Sep 23, 2022

Conversation

dlech
Copy link
Collaborator

@dlech dlech commented Sep 23, 2022

Changed

Fixed

dlech and others added 19 commits September 12, 2022 15:31
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
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.
@dlech dlech merged commit 655498c into master Sep 23, 2022
@dlech dlech deleted the release/0.18.0 branch September 23, 2022 17:09
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.

3 participants