Distinguish between UNKNOWN and missing profile

This commit modifies the `AppleFactory` to correctly handle `PodDevice.Model.UNKNOWN`.

Previously, if a device's model was `UNKNOWN`, it wouldn't match any profile and `isIRKMatch` would be false. This change ensures that `isIRKMatch` reflects the actual IRK match status, regardless of whether a specific profile is found.

Devices with an `UNKNOWN` model can now match profiles that are also marked as `UNKNOWN`, allowing for generic profile matching when the specific model isn't identified.
This commit is contained in:
darken
2025-09-29 13:37:01 +02:00
parent d2d126e9d9
commit b6027186c0
@@ -98,7 +98,7 @@ class AppleFactory @Inject constructor(
meta = ApplePods.AppleMeta(),
)
profile = profiles
.filter { it.model == tempDevice.model }
.filter { it.model == PodDevice.Model.UNKNOWN || it.model == tempDevice.model }
.filter { it.minimumSignalQuality <= tempDevice.signalQuality }
.firstOrNull()
}
@@ -107,7 +107,7 @@ class AppleFactory @Inject constructor(
scanResult = scanResult,
payload = payload,
meta = ApplePods.AppleMeta(
isIRKMatch = profile != null,
isIRKMatch = isIrkMatch,
profile = profile,
),
)