Skip to content

Releases: hbldh/bleak

v0.15.0

29 Jul 16:53
Compare
Choose a tag to compare

Added

  • Added new assigned_numbers module and AdvertisementDataType enum.
  • Added new bluez kwarg to BleakScanner in BlueZ backend.
  • Added support for passive scanning in the BlueZ backend. Fixes #606.
  • Added option to use cached services, characteristics and descriptors in WinRT backend. Fixes #686.
  • Added PendingDeprecationWarning to use of address_type as keyword argument. It will be moved into the
    winrt keyword instead according to #623.
  • Added better error message when adapter is not present in BlueZ backend. Fixes #889.

Changed

  • Add py.typed file so mypy discovers Bleak's type annotations.
  • UUID descriptions updated to 2022-03-16 assigned numbers document.
  • Replace use of deprecated asyncio.get_event_loop() in Android backend.
  • Adjust default timeout for read_gatt_char() with CoreBluetooth to 10s. Merged #891.
  • BleakScanner() args detection_callback and service_uuids are no longer keyword-only.
  • BleakScanner() arg scanning_mode is no longer Windows-only and is no longer keyword-only.
  • All BleakScanner() instances in BlueZ backend now use common D-Bus object manager.
  • Deprecated filters kwarg in BleakScanner in BlueZ backend.
  • BlueZ version is now checked on first connection instead of import to avoid import side effects. Merged #907.

Fixed

  • Documentation fixes.
  • On empty characteristic description from WinRT, use the lookup table instead of returning empty string.
  • Fixed detection of first advertisement in BlueZ backend. Merged #903.
  • Fixed performance issues in BlueZ backend caused by calling "GetManagedObjects" each time a
    BleakScanner scans or BleakClient is connected. Fixes #500.
  • Fixed not handling "InterfacesRemoved" in BleakClient in BlueZ backend. Fixes #882.
  • Fixed leaking D-Bus socket file descriptors in BlueZ backend. Fixes #805.

Version 0.14.3

29 Apr 18:53
0361ba4
Compare
Choose a tag to compare

Changed

  • Suppress macOS 12 scanner bug error message for macOS 12.3 and higher. Fixes #720.
  • Added filters Discoverable and Pattern to BlueZ D-Bus scanner. Fixes #790.

Fixed

  • Fixed reading the battery level returns a zero-filled bytearray on BlueZ >= 5.48. Fixes #750.
  • Fixed unpairing does not work on windows with WinRT. Fixes #699
  • Fixed leak of _disconnect_futures in CentralManagerDelegate.
  • Fixed callback not removed from _disconnect_callbacks on disconnect in CentralManagerDelegate.

Version 0.14.2

26 Jan 19:51
d6c208f
Compare
Choose a tag to compare

Changed

  • Updated bleak-winrt dependency to v1.1.1. Fixes #741.

Fixed

  • Fixed name is 'Unknown' in WinRT backend. Fixes #736.

Version 0.14.1

12 Jan 18:44
Compare
Choose a tag to compare

Fixed

  • Fixed AttributeError when passing BLEDevice to BleakClient constructor on WinRT backend. Fixes #731.

Version 0.14.0

10 Jan 16:49
Compare
Choose a tag to compare

Added

  • Added service_uuids kwarg to BleakScanner. This can be used to work
    around issue of scanning not working on macOS 12. Fixes #230. Works around #635.
  • Added UUIDs for LEGO Powered Up Smart Hubs.

Changed

  • Changed WinRT backend to use GATT session status instead of actual device
    connection status.
  • Changed handling of scan response data on WinRT backend. Advertising data
    and scan response data is now combined in callbacks like other platforms.
  • Updated bleak-winrt dependency to v1.1.0. Fixes #698.

Fixed

  • Fixed InvalidStateError in CoreBluetooth backend when read and notification
    of the same characteristic are used. Fixes #675.
  • Fixed reading a characteristic on CoreBluetooth backend also triggers notification
    callback.
  • Fixed in Linux, scanner callback not setting metadata parameters. Merged #715.

Version 0.13.0

20 Oct 19:06
Compare
Choose a tag to compare

Added

  • Allow 16-bit UUID string arguments to get_service() and get_characteristic().
  • Added register_uuids() to augment the uuid-to-description mapping.
  • Added support for Python 3.10.
  • Added force_indicate keyword argument for WinRT backend client's start_notify method. Fixes #526.
  • Added python-for-android backend.

Changed

  • Changed from winrt dependency to bleak-winrt.
  • Improved error when connecting to device fails in WinRT backend. Fixes #647.
  • Changed examples to use asyncio.run().
  • Changed the default notify method for the WinRT backend from Indicate to Notify.
  • Refactored GATT error handling in WinRT backend.
  • Changed Windows Bluetooth packet capture instructions. Fixes #653.
  • Replaced usage of deprecated @abc.abstractproperty.
  • Use asyncio.get_running_loop() instead of asyncio.get_event_loop().
  • Changed "service is already present" exception to logged error in BlueZ backend. Merged #622.

Removed

  • Removed dotnet backend.
  • Dropped support for Python 3.6.
  • Removed use_cached kwarg from BleakClient connect() and get_services() methods. Fixes #646.

Fixed

  • Fixed unused timeout in the implementation of BleakScanner's find_device_by_address() function.
  • Fixed BleakClient ignoring the adapter kwarg. Fixes #607.
  • Fixed writing descriptors in WinRT backend. Fixes #615.
  • Fixed race on disconnect and cleanup of BlueZ matches when device disconnects early. Fixes #603.
  • Fixed memory leaks on Windows.
  • Fixed protocol error code descriptions on WinRT backend. Fixes #532.
  • Fixed race condition hitting assentation in BlueZ disconnect() method. Fixes #641.
  • Fixed enumerating services on a device with HID service on WinRT backend. Fixes #599.
  • Fixed subprocess running to check BlueZ version each time a client is created. Fixes #602.
  • Fixed exception when discovering services after reconnecting in CoreBluetooth backend.

Version 0.12.1

07 Jul 21:37
65b6db8
Compare
Choose a tag to compare

This is a minor bug fix release.

Changed

  • Changed minimum winrt package version to 1.0.21033.1. Fixes #589.

Fixed

  • Fixed unawaited future when writing without response on CoreBluetooth backend.
    Fixes #586.

Version 0.12.0

19 Jun 15:10
9081411
Compare
Choose a tag to compare

Added

  • Added mtu_size property for clients.
  • Added WinRT backend.
  • Added BleakScanner.discovered_devices property.
  • Added an event to await when stopping scanners in WinRT and pythonnet backends. Fixes #556.
  • Added BleakScanner.find_device_by_filter static method.
  • Added scanner_byname.py example.
  • Added optional command line argument to specify device to all applicable examples.

Changed

  • Added Programming Language :: Python :: 3.9 classifier in setup.py.
  • Deprecated BleakScanner.get_discovered_devices() async method.
  • Added capability to handle async functions as detection callbacks in BleakScanner.
  • Added error description in addition to error name when BleakDBusError is converted to string.
  • Change typing of data parameter in write methods to Union[bytes, bytearray, memoryview].
  • Improved type hints in CoreBluetooth backend.
  • Use delegate callbacks for get_rssi() on CoreBluetooth backend.
  • Use @objc.python_method where possible in PeripheralDelegate class.
  • Using ObjC key-value observer to wait for BleakScanner.start() and stop()
    in CoreBluetooth backend.

Fixed

  • Fixed KeyError when trying to connect to BLEDevice from advertising
    data callback on macOS. Fixes #448.
  • Handling of undetected devices in connect_by_bledevice.py example. Fixes #487.
  • Added Optional typehint for BleakScanner.find_device_by_address.
  • Fixed linux_autodoc_mock_import in docs/conf.py.
  • Minor fix for disconnection event handling in BlueZ backend. Fixes #491.
  • Corrections for the Philips Hue lamp example. Merged #505.
  • Fixed BleakClientBlueZDBus.pair() method always returning True. Fixes #503.
  • Fixed waiting for notification start/stop to complete in CoreBluetooth backend.
  • Fixed write without response on BlueZ < 5.51.
  • Fixed error propagation for CoreBluetooth events.
  • Fixed failed import on CI server when BlueZ is not installed.
  • Fixed notification value should be bytearray on CoreBluetooth. Fixes #560.
  • Fixed crash when cancelling connection when Python runtime shuts down on
    CoreBluetooth backend. Fixes #538.
  • Fixed connecting to multiple devices using a single BleakScanner on
    CoreBluetooth backend.
  • Fixed deadlock in CoreBluetooth backend when device disconnects while
    callbacks are pending. Fixes #535.
  • Fixed deadlock when using more than one service, characteristic or descriptor
    with the same UUID on CoreBluetooth backend.
  • Fixed exception raised when calling BleakScanner.stop() when already
    stopped in CoreBluetooth backend.

Version 0.11.0

18 Mar 09:02
f03d868
Compare
Choose a tag to compare

0.11.0 (2021-03-17)

Added

  • Updated dotnet.client.BleakClientDotNet connect method docstring.
  • Added AdvertisementServiceData in BLEDevice in macOS devices
  • Protection levels (encryption) in Windows backend pairing. Solves #405.
  • Philips Hue lamp example script. Relates to #405.
  • Keyword arguments to get_services method on BleakClient.
  • Keyword argument use_cached on .NET backend, to enable uncached reading
    of services, characteristics and descriptors in Windows.
  • Documentation on troubleshooting OS level caches for services.
  • New example added: Async callbacks with a queue and external consumer
  • handle property on BleakGATTService objects
  • service_handle property on BleakGATTCharacteristic objects
  • Added more specific type hints for BleakGATTServiceCollection properties.
  • Added asyncio task to disconnect devices on event loop crash in BlueZ backend.
  • Added filtering on advertisement data callbacks on BlueZ backend so that
    callbacks only occur when advertising data changes like on macOS backend.
  • Added fallback to try org.bluez.Adapter1.ConnectDevice when trying to connect
    a device in BlueZ backend.
  • Added UART service example.

Fixed

  • Fixed wrong OS write method called in write_gatt_descriptor() in Windows
    backend. Merged #403.
  • Fixed BaseBleakClient.services_resolved not reset on disconnect on BlueZ
    backend. Merged #401.
  • Fixed RSSI missing in discovered devices on macOS backend. Merged #400.
  • Fixed scan result shows 'Unknown' name of the BLEDevice. Fixes #371.
  • Fixed a broken check for the correct adapter in BleakClientBlueZDBus.
  • Fixed #445 and #362 for Windows.

Changed

  • Using handles to identify the services. Added handle abstract property to BleakGATTService
    and storing the services by handle instead of UUID.
  • Changed BleakScanner.set_scanning_filter() from async method to normal method.
  • Changed BlueZ backend to use dbus-next instead of txdbus.
  • Changed BleakClient.is_connected from async method to property.
  • Consolidated D-Bus signal debug messages in BlueZ backend.

Removed

  • Removed all __str__ methods from backend service, characteristic and descriptor implementations
    in favour of those in the abstract base classes.

Version 0.10.0

11 Dec 19:52
f53463f
Compare
Choose a tag to compare

Added

  • Added AdvertisementData class used with detection callbacks across all supported platforms. Merged #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 #381.

Fixed

  • Fixed use of bare exceptions.
  • Fixed BleakClientBlueZDBus.start_notify() misses initial notifications with fast Bluetooth devices. Fixed #374.
  • Fix event callbacks on Windows not running in asyncio event loop thread.
  • Fixed BleakScanner.discover() on older versions of macOS. Fixes #331.
  • Fixed disconnect callback on BlueZ backend.
  • Fixed calling BleakClient.is_connected() on Mac before connection.
  • Fixed kwargs ignored in BleakScanner.find_device_by_address() in BlueZ backend. Fixes #360.

Removed

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