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/v0.10.0 #391

Merged
merged 57 commits into from
Dec 11, 2020
Merged

Release/v0.10.0 #391

merged 57 commits into from
Dec 11, 2020

Conversation

dlech
Copy link
Collaborator

@dlech dlech commented Dec 11, 2020

Added

  • Added AdvertisementData class used with detection callbacks across all
    supported platforms. Merged Standardizing arguments passed to callback functions #334.
  • Added BleakError raised during import on unsupported platforms.
  • Added rssi parameter to BLEDevice constructor.
  • Added detection_callback kwarg to BleakScanner constructor.

Changed

  • Updated minimum PyObjC version to 7.0.1.
  • Consolidated implementation of BleakScanner.register_detection_callback().
    All platforms now take callback with BLEDevice and AdvertisementData
    arguments.
  • Consolidated BleakScanner.find_device_by_address() implementations.
  • Renamed device kwarg to adapter in BleakClient and BleakScanner. Fixes
    rename "device" to "adapter" #381.

Fixed

Removed

  • Removed duplicate definition of BLEDevice in BlueZ backend.
  • Removed unused imports.
  • Removed separate implementation of global discover method.

hbldh and others added 30 commits October 22, 2020 11:15
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.
…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
Fixed ``BleakScanner.discover()`` on older versions of macOS.
Standardizing arguments passed to callback functions
dlech and others added 25 commits December 7, 2020 16:22
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.
Use `BleakScanner.discover` instead of "old" `discover`. (follow up of #387)
@dlech dlech merged commit f53463f into master Dec 11, 2020
Copy link
Owner

@hbldh hbldh left a 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!

@dlech
Copy link
Collaborator Author

dlech commented Dec 11, 2020

I hope I didn't get too carried away and unintentionally break too many things along the way 😄

@hbldh
Copy link
Owner

hbldh commented Dec 11, 2020

That is one of key inherent buzzes of a release imo.

@dlech dlech deleted the release/v0.10.0 branch March 29, 2021 15:41
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.

None yet

4 participants