If no matching services are found when connecting to a device, default to BLEManager.

GATT characteristics are not necessarily exposed as services.
This commit is contained in:
Fabio Manganiello 2023-03-23 13:00:26 +01:00
parent d1cd6dd2af
commit af125347d6
Signed by: blacklight
GPG Key ID: D90FBA7F76362774
1 changed files with 3 additions and 4 deletions

View File

@ -238,10 +238,9 @@ class BluetoothPlugin(RunnablePlugin, EntityManager):
else [srv for srv in device.services if srv.uuid == uuid] else [srv for srv in device.services if srv.uuid == uuid]
) )
assert matching_services, ( if not matching_services:
f'No service found on the device {device} for port={port}, ' # It could be a GATT characteristic, so try BLE
f'service_uuid={service_uuid}' return self._managers[BLEManager]
)
srv = matching_services[0] srv = matching_services[0]
return ( return (