Fix BLE monitor new beacon check (#2918)

This commit is contained in:
Joris Pelgröm 2022-09-26 16:52:28 +02:00 committed by GitHub
parent e541db2ca8
commit db98a7ced3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -38,10 +38,10 @@ class IBeaconMonitor {
val minor = newBeacon.id3.toString()
val distance = round(newBeacon.distance * 100) / 100
val rssi = newBeacon.runningAverageRssi
if (!tmp.contains(uuid)) { // we found a new beacon
if (!tmp.contains(name(uuid, major, minor))) { // we found a new beacon
requireUpdate = true
}
tmp += Pair(uuid, IBeacon(uuid, major, minor, distance, rssi, 0))
tmp += Pair(name(uuid, major, minor), IBeacon(uuid, major, minor, distance, rssi, 0))
}
val sorted = sort(tmp.values).toMutableList()
if (requireUpdate) {