-
Notifications
You must be signed in to change notification settings - Fork 310
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.21.0 #1410
Merged
Merged
Release/0.21.0 #1410
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
The error messages were reporting something like: <_bleak_winrt_Windows_Devices_Bluetooth_GenericAttributeProfile.GattDeviceService object at 0x00000206F9189750> This is the repr of the service object which isn't very useful. Change the error message to include some useful identification properties instead.
We had a hard-coded list of services know to return an access denied error when attempting to enumerate characteristics. However, since we don't know Windows internals, the list was not exhaustive and it could also change in the future. Instead, we can just check for the access denied error and skip any service that returns that error which should also handle additional services we don't know about yet. Fixes: #1291
Bumps [requests](https://github.com/psf/requests) from 2.28.1 to 2.31.0. - [Release notes](https://github.com/psf/requests/releases) - [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md) - [Commits](psf/requests@v2.28.1...v2.31.0) --- updated-dependencies: - dependency-name: requests dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]>
Also fix missing `:` and don't create unnecessary instance of BleakScanner. Fixes: #1334
Function `register_detection_callback()` of `BaseBleakScanner` ensures that `_callback` is a synchronous function, so change its typing accordingly. Additionally, passing `Awaitable` to `asyncio.create_task()` results in warning: Unexpected type(s): (Awaitable[None] | None) Possible type(s): (Generator[Any, None, Any] | Coroutine) Every coroutine is an awaitable, but not every awaitable is a coroutine, so change the `AdvertisementDataFilter` type accordingly.
This fixes a possible race condition where `_stopped_handler()` is scheduled via `call_soon_threadsafe()`, then `self.watcher` is set to none before the callback is actually run. Fixes: #1330
As noted in <#1286>, it does not work on macOS 10.15.
Bumps [pygments](https://github.com/pygments/pygments) from 2.13.0 to 2.15.0. - [Release notes](https://github.com/pygments/pygments/releases) - [Changelog](https://github.com/pygments/pygments/blob/master/CHANGES) - [Commits](pygments/pygments@2.13.0...2.15.0) --- updated-dependencies: - dependency-name: pygments dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]>
We are considering adding an async iterator that can be used to handle advertisement data as it is received. It will be trivial for users to create multiple parallel iterators, so instead of disallowing it, this prepares the way to allow multiple simultaneous subscribers.
It has been noted that IntEnum.__str__() has changed in Python 3.11 and now only prints integers instead of the name of the enum. This changes all logging messages that use enums in the WinRT backend to use %r for repr() so that we get both the name and the value. Fixes: #1284 Also changes uses of str.format() to f-strings and remove uses of format string from loggers while we are touching this.
This fixes several issues with the implementation. Notably, on Linux trying to scan and connect to two devices at the same time results in: bleak.exc.BleakDBusError: [org.bluez.Error.InProgress] Operation already in progress This is worked around by using an asyncio.Lock to ensure only one scan and connect is called at a time. Fixes: #1036 Also fixes error due to main() not being a coroutine: ValueError: a coroutine was expected, got <_GatheringFuture pending> Fixes: #1288 Finally, command line args are added to make it easy to run the example without modifying the code.
This adds additional utility functions for converting 16-bit and 32-bit int values to Bleak's normalized UUID str format. Issue: #1342
This simplifies some uses of UUIDs by taking advantage of the short string form or utility functions.
Use `*` instead of `-` to be consistent.
Previously, some backends would select the "best" response type based on the reported characteristics while some did not. For the ones that didn't, it was a commonly reported issue for the write to not work. This adds a recommendation to the docs to always be explicit about the requested response type and moves the common logic for picking the "best" type in the default case to the BleakClient class to avoid duplicated code. The logic is simplified to prefer a write with response if available and no longer reports a warning for devices that don't properly specify properties (since it would create much noise with many writes). Fixes: #909
Add `advertisement_data()` async iterator method to the `BleakScanner` which yields results of the ongoing scan.
- Switch usage of f-strings for log message formatting - Guard expensive loggers with isEnableFor
This makes sure all methods of the BlueZManager are checking that the adapter or device exists in BlueZ before continuing with the method. Documentation is updated to indicate which functions have this check and which do not.
…es_discovery() This adds a 3rd race condition to _wait_for_services_discovery() to handle the case where an interface is removed from BlueZ without changing the "Connected" property. This can happen, e.g. when we hit "retry due to le-connection-abort-by-local".
This adds a device path key to the condition callbacks. This will avoid calling callbacks for other devices that are not the subject of the current "PropertiesChanged" signal.
* Android : updated requirements, permissions and archs in buildozer.spec * Fixed bleak recipe for android The current develop branch of p4a uses the setup.py to install the recipe and doesn't seem compliant with PEP517 yet. The temporary fix is to provide a setup.py during the build stage for android. Also, the recipe is now more generic, so it can easily be used in your own projects.
This makes it easy to get up and running with vscode.
It appears that GattDeviceService.Close() can hang forever under certain circumstances. This change adds a 0.1 second delay before closing services to see if that helps. Fixes: #1359
WinError does the same thing and is a bit more straight forward.
Python 3.12 introduces a new type to indicate the C buffer protocol. We can use this to more correctly indicate allowable types.
Python 3.7 has reached end of life.
This ensures we get support for Python 3.12.
Most of the class methods for BleakScanner allow passing **kwargs to the BleakScanner() constructor. PEP 692 now gives us a way to have proper type hints for this.
The winrt packages are now being distributed as individual namespace packages, so we can take advantage of that instead of having to provide our own bleak_winrt package. The new packages haven't been tested much yet, so just enabling on Python 3.12 for now.
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.
Added
bleak.uuids.normalize_uuid_16()
function.bleak.uuids.normalize_uuid_32()
function.advertisement_data()
async iterator method toBleakScanner
. Merged BleakScanner: Add async iterator scanning capability #1361.BleakScanner
class methods.Changed
response
argument inBleakClient.write_gatt_char
.Fixes Feature request: BleakClient.write_gatt_char response default should be dynamic #909.
BlueZManager
methods to raiseBleakError
when device is not in BlueZ.collections.abc.Buffer
.Fixed
BaseBleakScanner
detection callback._stopped_handler()
in WinRT backend. Fixes Scanner periodically crashes on Windows #1330."InterfaceRemoved"
when getting services in BlueZ backend.