Skip to content

Commit d0c761e

Browse files
Copilotbgoncal
andcommitted
Fix duplicate model identifier and improve documentation
- Removed duplicate mac15,3 from MacBook Air list (it's a MacBook Pro) - Enhanced comments to explain why explicit allowlist is necessary - Added reference to everymac.com for future maintainers Co-authored-by: bgoncal <5808343+bgoncal@users.noreply.github.com>
1 parent 60c36be commit d0c761e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Sources/Shared/API/Webhook/Sensors/LastUpdateSensor.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,14 @@ public class LastUpdateSensor: SensorProvider {
1818
icon = "mdi:laptop"
1919
} else {
2020
// Known MacBook model identifiers (new style Mac##,##)
21-
// This list should be updated as new MacBook models are released
21+
// NOTE: This list must be updated when Apple releases new MacBook models.
22+
// Apple's model numbering doesn't follow a predictable pattern that would allow
23+
// programmatic detection, so an explicit allowlist is the most reliable approach.
24+
// See: https://everymac.com/systems/by_capability/mac-specs-by-machine-model-machine-id.html
2225
let knownLaptopModels: Set<String> = [
2326
// MacBook Air models
2427
"mac14,2", "mac14,15", // M2
25-
"mac15,3", "mac15,12", "mac15,13", // M3
28+
"mac15,12", "mac15,13", // M3
2629
"mac16,12", "mac16,13", // M4
2730
// MacBook Pro models
2831
"mac14,5", "mac14,6", "mac14,7", "mac14,9", "mac14,10", // M2

0 commit comments

Comments
 (0)