Fix: linux: getSystemDevices (#154)

Make sure getSystemDevices connects the bluez client first.
This ensures that the list of devices is correctly populated.

Signed-off-by: Tim Froidcoeur <tim.froidcoeur@comate.be>
Co-authored-by: Tim Froidcoeur <tim.froidcoeur@comate.be>
This commit is contained in:
tfroidcoeur
2025-04-26 22:02:49 +02:00
committed by GitHub
parent f26951834d
commit 3194b0ad49
@@ -350,6 +350,7 @@ class UniversalBleLinux extends UniversalBlePlatform {
Future<List<BleDevice>> getSystemDevices(
List<String>? withServices,
) async {
await _ensureInitialized();
List<BlueZDevice> devices =
_client.devices.where((device) => device.connected).toList();
if (withServices != null && withServices.isNotEmpty) {