diff options
| author | uvok | 2025-08-03 16:53:58 +0200 | 
|---|---|---|
| committer | uvok | 2025-08-03 16:53:58 +0200 | 
| commit | 219873af0db1bf8977a3804328fd5e524a08df2f (patch) | |
| tree | 8d1c69d1f3b381c620ebab4cfd0ce04633133626 | |
| parent | 671c6aa65937c914413ce53bbb855ee780b7df21 (diff) | |
UB: Keep updating RSSI
| -rw-r--r-- | lib/control/universal_ble_scanner_controller.dart | 19 | 
1 files changed, 10 insertions, 9 deletions
| diff --git a/lib/control/universal_ble_scanner_controller.dart b/lib/control/universal_ble_scanner_controller.dart index 07608fa..6cad770 100644 --- a/lib/control/universal_ble_scanner_controller.dart +++ b/lib/control/universal_ble_scanner_controller.dart @@ -40,15 +40,16 @@ class UniversalBleScannerController extends ScannerControllerImpl {    }    void _newDeviceAction(BleDevice dev) { -    //logger.i("Found device: ${dev.toString()}"); -    bool added = _devices.addIf(dev, (exDev) => exDev.deviceId != dev.deviceId); -    if (added) { -      super.setDevices( -        _devices -            .map((d) => UniversalBleDevice.fromDevice(d)) -            .toList(growable: false), -      ); -    } +    // very spammy! +    // logger.i("Found device: ${dev.toString()}"); + +    _devices.addOrReplaceKey(dev, keySelector: (d) => d.deviceId); + +    super.setDevices( +      _devices +          .map((d) => UniversalBleDevice.fromDevice(d)) +          .toList(growable: false), +    );    }    void _newAvailabilityAction(AvailabilityState event) { | 
