mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
fix: fixed Apple Silicon sensors naming (#756)
This commit is contained in:
@@ -195,13 +195,17 @@ internal class AppleSilicon_SensorsReader: SensorsReader {
|
||||
var name: String = key
|
||||
var g: SensorGroup = group
|
||||
|
||||
AppleSiliconSensorsList.filter{ $0.key.contains("%") }.forEach { (s: Sensor) in
|
||||
var index = 1
|
||||
for i in 0..<64 {
|
||||
if s.key.replacingOccurrences(of: "%", with: "\(i)") == key {
|
||||
name = s.name.replacingOccurrences(of: "%", with: "\(index)")
|
||||
AppleSiliconSensorsList.forEach { (s: Sensor) in
|
||||
if s.key.contains("%") {
|
||||
var index = 1
|
||||
for i in 0..<64 {
|
||||
if s.key.replacingOccurrences(of: "%", with: "\(i)") == key {
|
||||
name = s.name.replacingOccurrences(of: "%", with: "\(index)")
|
||||
}
|
||||
index += 1
|
||||
}
|
||||
index += 1
|
||||
} else if s.key == key {
|
||||
name = s.name
|
||||
}
|
||||
g = s.group
|
||||
}
|
||||
|
||||
@@ -239,6 +239,6 @@ let AppleSiliconSensorsList: [Sensor] = [
|
||||
Sensor(key: "PMU tdev%", name: "Power management unit dev %", group: .sensor, type: .temperature),
|
||||
Sensor(key: "PMU tdie%", name: "Power management unit die %", group: .sensor, type: .temperature),
|
||||
|
||||
Sensor(key: "Gas gauge battery", name: "Battery", group: .sensor, type: .temperature),
|
||||
Sensor(key: "gas gauge battery", name: "Battery", group: .sensor, type: .temperature),
|
||||
Sensor(key: "NAND CH% temp", name: "Disk %s", group: .GPU, type: .temperature)
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user