-
Notifications
You must be signed in to change notification settings - Fork 283
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/v0.10.0 #391
Release/v0.10.0 #391
Conversation
Merge master back to develop after release of 0.9.1
The `BLEDevice` class is already defined for all backends in `bleak/backends/device.py`. It looks like an extra copy is left over in the CoreBluetooth that can be removed.
The arguments listed were probably for a older version of the function. This also fixes an unused import warning from flake8 since IAsyncOperation is now used for the type hint.
This fixes flake8 E722. Using bare except will also catch BaseException which would suppress things like KeyboardInterrupt.
This fixes flake8 E713.
black randomly decided that it wants commas here now
E203: black adds spaces around `:` in some cases E501: black allows long lines in some cases W503: black disagrees with flake8 on line breaks before binary operators
As reported by flake8 F401.
As reported by flake8 F841.
Cleanups
…y() after the callback has been stored in the _notification_callbacks dict
Fixed issue #374 by moving the dbus 'StartNotify' call in start_notif…
This reduces one level of indirection by importing individual types from Windows.Devices.Enumeration.
Callbacks from .NET events need to use call_soon_threadsafe() to schedule them in the event loop. Otherwise they will run in a background thread, which causes concurrency issues and also silently swallows unhandled exceptions. Also add type hints to callbacks while we are touching this code.
This avoids a crash on macOS <= 10.15 in PyObjC 7.0.0. Fixes #372
CoreBluetooth: update PyObjC to 7.0.1
fix dotnet event callbacks
Fixed ``BleakScanner.discover()`` on older versions of macOS.
Standardizing arguments passed to callback functions
This change was not released until 5.51 (see bluez/bluez@fa9473b)
…ck(). Since #334, all backends have the same implementation of `BleakScanner.register_detection_callback()` and the documentation was out of date. This consolidates the implementation in the abstract base class and updates the type hints and documentation.
If `BleakClient.is_connected()` is called before `BleakClient.connect()`, `self._central_manager_delegate` will be `None`, which was leading to a crash. Fixes #385
Fixed calling BleakClient.is_connected() on Mac before connection.
This adds a more informative error message for unsupported platforms. Previously the if block would fall through which would likely cause `AttributeError`s or `ImportError`s.
The "old" `discover()` method was largely duplicating the code from `BleackScanner.discover()`, with the exception of the Mac backend which looked like it might not even work correctly and ignored kwargs. This removes the `discover()` method from the documentation and removes the separate implementation. The name is still kept and made as a synonym for for `BleakScanner.discover` so that we don't completely break existing code that might be using it.
…ed first. This adds an `from BleakBridge import Bridge` to all files that use winrt bindings. This ensures that imports work no matter which module is imported first.
The changelog says this was removed in v0.7.0, but it is still here.
Removed dead code in BlueZ backend.
Consolidated implementation of BleakScanner.register_detection_callback()
Removed separate implementation of global discover method.
This adds an `rssi` parameter to `BLEDevice.__init__()`. This way, `BLEDevice` doesn't have to know about platform-specific backends.
It is useful to have a BLEDevice in the callback so that you can pass it to BleakClient without having to wait for scanning to stop or calling get_discovered_devices() and filtering for the matching device.
This allow setting the detection callback when the BleakScanner is created. This is useful when using the scanner as a context manager.
Now that all backends have a common detection callback, we can use that to get rid of the platform-specific implementations of find_device_by_address().
In advertisement data, the local name should be None if not present.
Detection callback improvments
Adapter kwarg fixes
Use `BleakScanner.discover` instead of "old" `discover`. (follow up of #387)
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.
A lot of changes, but I have seen most changes along the way and trust them. It is good progress in very little time; thank you @dlech!
I hope I didn't get too carried away and unintentionally break too many things along the way 😄 |
That is one of key inherent buzzes of a release imo. |
Added
AdvertisementData
class used with detection callbacks across allsupported platforms. Merged Standardizing arguments passed to callback functions #334.
BleakError
raised during import on unsupported platforms.rssi
parameter toBLEDevice
constructor.detection_callback
kwarg toBleakScanner
constructor.Changed
BleakScanner.register_detection_callback()
.All platforms now take callback with
BLEDevice
andAdvertisementData
arguments.
BleakScanner.find_device_by_address()
implementations.device
kwarg toadapter
inBleakClient
andBleakScanner
. Fixesrename "device" to "adapter" #381.
Fixed
BleakClientBlueZDBus.start_notify()
misses initial notifications withfast Bluetooth devices. Fixed BleakClientBlueZDBus.start_notify() misses initial notifications with fast Bluetooth devices #374.
BleakScanner.discover()
on older versions of macOS. Fixes macOS / CoreBluetooth connection error: "objc.error: NSInternalInconsistencyException - Invalid parameter not satisfying: [identifiers isKindOfClass:[NSArray class]]" #331.BleakClient.is_connected()
on Mac before connection.BleakScanner.find_device_by_address()
in BlueZ backend.Fixes Adapter parameter ignored on BleakClient #360.
Removed
BLEDevice
in BlueZ backend.discover
method.