-
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
Concrete top level classes #982
Conversation
a193c4f
to
c5191b7
Compare
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.
c5191b7
to
e759b45
Compare
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.
def __init__( | ||
self, | ||
device_or_address: Union[BLEDevice, str], | ||
disconnected_callback: Optional[Callable[[BleakClient], None]] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this keyword arg snuck in before the *
pylint was complaining when I was doing testing keyword-arg-before-vararg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, this is intentional, the arg is now positional or keyword
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.
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.
This is a partial alternative to some of the code changes in #904. It implements the suggestion of creating new
BleakScanner
andBleakClient
objects. This solves some of the documentation complications compared to the approach in #904 of using multiple inheritance. Also it will allow us to refactor some duplicated code between the backends in the future, like checking if a device is still connected and wrapping coroutine callbacks.It is not a complete alternative to #904 as there are some really nice documentation improvements there that I think we should still pick up. And there are some other classes that are not backend-specific that could be moved out of the
backends
module, but they can be handled one at a time and at a later date.cc: @jackjansen
Fixes: #582.