-
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
Release/v0.17.0 #1006
Merged
Merged
Release/v0.17.0 #1006
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
This changes the disconnect timeout on the WinRT backend to 120s. Sometimes it can take up to a minute for Windows to actually close the GATT session/disconnect the device. This behavior is also seen in other apps, like WebBluetooth in Chrome. Furthermore, the device remains connected even after the app is closed, so clearly this is an issue with the Windows Bluetooth stack and not something that can be fixed in userspace code. Fixes #807.
We are decoding the ATT error message number to a string. This was using the wrong lookup table for the messages. `PROTOCOL_ERROR_CODES` matches `BT_ATT_ERROR_*` in the BlueZ source.
This was missed in 1ac732a.
This changes the battery workaround version check to exclude BlueZ versions >=5.55 since the battery service was re-exposed in [1]. [1]: bluez/bluez@713f6f0
Essentially, the BLEDeviceCoreBluetooth class was being using to pass the last-seen RSSI value for an advertisement for each device. So we can simplify things by dropping the class and only keep track of the last RSSI value.
This changes the build system from setuptools to poetry. This allows us to avoid duplicating the package dependencies 3 times and also include a lock file so that devs are working from the same package versions.
Several dependencies were not added. This is evident when trying to build the docs without installing main dependencies. Also simplify and move after imports while we are touching this.
The TypedDict type breaks autodoc mocks in sphinx, so we can avoid the problem by ensuing that sphinx uses python >=3.8 and only use the typing-extensions package for python 3.7.
This adds a connection check to all methods that require a connection in the WinRT backend similar to what is already done in the BlueZ backend. This fixes an issue where we would get an AttribueError in the connect method while getting services caused by the device disconnecting after connecting but before getting the services. Now a more informative exception is raised instead.
backends/winrt/client: extend disconnect timeout
exc: fix BlueZ ATT error messages
BlueZ battery fixes
drop BLEDeviceCoreBluetooth
use poetry for build and deps
This fixes build docs on Python >=3.10. Also update readthedocs.yml with new requirements.txt to fix failing builds.
docs: update sphinx to latest version
This fixes all instances of flake8 E402 and enables CI to fail on future instances of this error.
flake8: fix E402 and enable in CI
This updates the docs for recent changes in dependency management.
docs: update for recent changes
…n requested (#923) If the device was previously connected and we have the the service collection already built, it can be reused for the next connection if the device has not since been removed from the bus when the dangerous_use_bleak_cache flag is passed. For devices that connect and disconnect frequently this can make operations up to an magnitude faster once the first connection has been made and the device has not been removed from the bus since the last connection.
…m-for-unpair-in-winrt-client Fixed use of wrong enum in unpair function of WinRT backend
Poetry seems to be picking up the wrong Python version when creating the virtual environment, so specify it explicitly using: poetry env use pythonX.Y
github: fix virtual env python version
* Switch from dbus_next to dbus_fast * remove workaround since its fixed in dbus-fast
…994) Co-authored-by: David Lechner <david@lechnology.com>
The `properties` and `descriptors` properties had inconsistent return types between backends. This makes them consistent in all backends.
It is possible that self._session is set to None when max_pdu_size_changed_handler is called. So we can use the sender arg instead to avoid a possible AttributeError. Fixes #998.
If the device disconnects right away for any reason, the on_connected_changed callback fires and clears the disconnect_monitor_event which results in the following exception: ``` File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 182, in connect asyncio.ensure_future(self._disconnect_monitor()) File "/usr/local/lib/python3.10/asyncio/tasks.py", line 615, in ensure_future return _ensure_future(coro_or_future, loop=loop) File "/usr/local/lib/python3.10/asyncio/tasks.py", line 636, in _ensure_future return loop.create_task(coro_or_future) Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 240, in _disconnect_monitor await self._disconnect_monitor_event.wait() AttributeError: NoneType object has no attribute wait ```
This was missed in #989.
The `# noqa: F401` directives were on the wrong line and not picked up by flake8. This moves them to correct line and also allows us to use the main flake8 config in CI since all errors are now fixed.
The discover() function was removed from the docs and was supposed to be deprecated some time ago, but it didn't get a proper warning and was still used in some examples. This removes it from the examples and adds a warning so that it can eventually be removed.
If specific adapter is not provided as a parameter, default adapter is selected automatically as a first adapter out of all powered adapter in the system, instead of using hardcoded "hci0". Additional logic to only choose powered adapters is added for two convenience reasons: - If adapter is powered down but selected for operation, Bleak will not power it on. Consequently, `org.bluez.Error.NotReady` error will occur anyway when trying to use such adapter. - If user has multiple adapters present on the system but currently uses only some while others are powered off, it most probably wants to use one of the active adapters. Signed-off-by: Bojan Potočnik <info@bojanpotocnik.com> Co-authored-by: David Lechner <david@pybricks.com>
PyPI rejected the upload because of the inclusion of the prefix.
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
AdvertisementData
class now has an attributetx_power
. Merged Added tx_power in advertisement_data for Windows, Mac and Linux #987.Changed
BleakClient
methods now raiseBleakError
if called when not connected in WinRT backend. Merged Fixget_services()
fails because no GattSession #973.To use the cache, call
connect
andget_services
with thedangerous_use_bleak_cache
argument to avoid services being resolved again. Merged Cache service resolution on connect when using BlueZ/Dbus backend when requested #923.
dbus-fast
package instead ofdbus-next
which significantly improves performance. Merged Switch from dbus_next to dbus_fast #988.discover()
method. Merged deprecate discover() function #1005.Fixed
AttributeError
when enabling notifications for battery service in BlueZ backend. Merged BlueZ battery fixes #976.properties
anddescriptors
properties ofBleakGATTCharacteristic
. Merged backends/characteristic: fix inconsistent property types #989.GetManagedObjects
returns in BlueZ backend. Fixes There is a race at startup when a device is removed before get managed objects finishes #996.max_pdu_size_changed_handler
in WinRT backend. Fixes AttributeError: 'NoneType' object has no attribute 'max_pdu_size' #998.Removed
BLEDeviceCoreBluetooth
type from CoreBluetooth backend. Merged drop BLEDeviceCoreBluetooth #977.