Releases: hbldh/bleak
Releases · hbldh/bleak
v0.15.0
Added
- Added new
assigned_numbers
module andAdvertisementDataType
enum. - Added new
bluez
kwarg toBleakScanner
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 ofaddress_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()
argsdetection_callback
andservice_uuids
are no longer keyword-only.BleakScanner()
argscanning_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 inBleakScanner
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 orBleakClient
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
Changed
- Suppress macOS 12 scanner bug error message for macOS 12.3 and higher. Fixes #720.
- Added filters
Discoverable
andPattern
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
inCentralManagerDelegate
. - Fixed callback not removed from
_disconnect_callbacks
on disconnect inCentralManagerDelegate
.
Version 0.14.2
Version 0.14.1
Fixed
- Fixed
AttributeError
when passingBLEDevice
toBleakClient
constructor on WinRT backend. Fixes #731.
Version 0.14.0
Added
- Added
service_uuids
kwarg toBleakScanner
. 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
Version 0.13.0
Added
- Allow 16-bit UUID string arguments to
get_service()
andget_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'sstart_notify
method. Fixes #526. - Added python-for-android backend.
Changed
- Changed from
winrt
dependency tobleak-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
toNotify
. - 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 ofasyncio.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 fromBleakClient
connect()
andget_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
Version 0.12.0
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 insetup.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 inPeripheralDelegate
class. - Using ObjC key-value observer to wait for
BleakScanner.start()
andstop()
in CoreBluetooth backend.
Fixed
- Fixed
KeyError
when trying to connect toBLEDevice
from advertising
data callback on macOS. Fixes #448. - Handling of undetected devices in
connect_by_bledevice.py
example. Fixes #487. - Added
Optional
typehint forBleakScanner.find_device_by_address
. - Fixed
linux_autodoc_mock_import
indocs/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 returningTrue
. 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 bebytearray
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
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 onBleakClient
. - 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 onBleakGATTService
objectsservice_handle
property onBleakGATTCharacteristic
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 toBleakGATTService
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 oftxdbus
. - 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
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 toBLEDevice
constructor. - Added
detection_callback
kwarg toBleakScanner
constructor.
Changed
- Updated minimum PyObjC version to 7.0.1.
- Consolidated implementation of
BleakScanner.register_detection_callback()
. All platforms now take callback withBLEDevice
andAdvertisementData
arguments. - Consolidated
BleakScanner.find_device_by_address()
implementations. - Renamed
device
kwarg toadapter
inBleakClient
andBleakScanner
. 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.