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 untrusted user: blacklight
GPG key ID: D90FBA7F76362774

View file

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