-
Notifications
You must be signed in to change notification settings - Fork 295
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.16.0 #969
Merged
Merged
release v0.16.0 #969
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
old link was getting 404 error
docs/troubleshooting: fix windows BTP link
Fixes logging-format-interpolation (W1202)
Make callback logging lazy
``` Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 357, in async_setup result = await component.async_setup_entry(hass, self) File "/usr/src/homeassistant/homeassistant/components/bluetooth/__init__.py", line 253, in async_setup_entry await manager.async_start( File "/usr/src/homeassistant/homeassistant/components/bluetooth/__init__.py", line 343, in async_start await self.scanner.start() # type: ignore[no-untyped-call] File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/scanner.py", line 128, in start manager = await get_global_bluez_manager() File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/manager.py", line 808, in get_global_bluez_manager await instance.async_init() File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/manager.py", line 344, in async_init await self._bus.disconnect() TypeError: object NoneType can't be used in 'await' expression ```
…ts during the connection process
When the dbus socket gets disconnected from dbus, we cannot reuse the connection because dbus-next finalize will remove the underlying fds Fixes ``` 2022-08-02 09:29:00.722 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Bluetooth for bluetooth Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 357, in async_setup result = await component.async_setup_entry(hass, self) File "/usr/src/homeassistant/homeassistant/components/bluetooth/__init__.py", line 253, in async_setup_entry await manager.async_start( File "/usr/src/homeassistant/homeassistant/components/bluetooth/__init__.py", line 343, in async_start await self.scanner.start() # type: ignore[no-untyped-call] File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/scanner.py", line 128, in start manager = await get_global_bluez_manager() File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/manager.py", line 808, in get_global_bluez_manager await instance.async_init() File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/manager.py", line 290, in async_init await self._bus.connect() File "/usr/local/lib/python3.10/site-packages/dbus_next/aio/message_bus.py", line 149, in connect await self._authenticate() File "/usr/local/lib/python3.10/site-packages/dbus_next/aio/message_bus.py", line 380, in _authenticate await self._loop.sock_sendall(self._sock, b0) File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 441, in sock_sendall n = sock.send(data) BrokenPipeError: [Errno 32] Broken pipe ```
Switch to using async_timeout for timeouts
Fix disconnect in the global BlueZ manager
Handle the race in the BlueZ D-Bus backend where the device disconnects during the connection process
Avoid reusing the MessageBus in the manager
In Python 3, we don't need to explicitly inherit from object.
…l_timeout Adjust default timeout for ``read_gatt_char()`` with CoreBluetooth to 20s
remove explicit inheritance from object
This moves the D-Bus interface property dict types to the defs module. This will help avoid circular imports of the manager module.
This adds a new max_write_without_response_size property to BleakGattClient that can be used to ensure data will be able to be used in a characteristic write without response command without causing an OS error. The NUS example is updated to show how to make use of this property.
This is not used, so can be removed.
This filter was originally added to get the same behavior as macOS. However macOS has changed so we receive duplicate events even when filter duplicates is enabled. This allows us to get RSSI change events to allow making proper user interfaces that show changing RSSI while scanning devices.
This moves the D-Bus interface property dict types to the defs module. This will help avoid circular imports of the manager module.
This adds maps to improve performance when calling get_services(). Previously we had to enumerate all BlueZ D-Bus objects for each service, characteristic and descriptor. When there were many devices, this was a performance bottleneck. Instead, we can create a map of the D-Bus object tree as new interfaces appear, then use this map as an efficient way to find the child D-Bus object paths in the GATT tree. Fixes #927.
Bluez: improve get services performance
BlueZ: don't ignore RSSI change in detection callbacks
remove top-level Makefile
Max write without response size
…rows It is possible for get_services() to raise an exception, e.g. if external code cancels the task. If this happens, we need to be sure that the device disconnects so the BlueZClient is in a consistent state (if the connect() method raises and exception, is is expected that the device will not be connected). To fix this, we can just move the call to get_services() inside of the existing try block that will disconnect on any exception, then reraise the exception. Fixes #951.
…d_devices This fixes a regression introduced in v0.15 where device removed from BlueZ while scanning were no longer removed from this list of discovered devices. This caused the `discovered_devices` property to return devices that could no longer be connected to by BlueZ since they were removed. Fixes #942.
…nning BlueZ: fix removed devices included in discovered_devices
BlueZ: fix not disconnecting if get_services() throws during connect
cc @bdraco |
Thanks |
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
BleakGattCharacteristic.max_write_without_response_size
property. Fixes Introduce per-characteristicmax_write_without_response_size
#738.Fixed
were still listed in
BleakScanner.discovered_devices
. Fixes Devices are no longer removed from.discovered_devices
on the bluez scanner when InterfacesRemoved is fired #942.Changed
BlueZManager.get_services()
. Fixes Linear searching is a performance bottleneck inBlueZManager.get_services
with many devices #927.Removed
BleakScanner
detection callbacks on BlueZ backend. Merged BlueZ: don't ignore RSSI change in detection callbacks #964.