diff --git a/Modules/Sensors/readers.swift b/Modules/Sensors/readers.swift index 77a96192..e253c8b5 100644 --- a/Modules/Sensors/readers.swift +++ b/Modules/Sensors/readers.swift @@ -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 } diff --git a/Modules/Sensors/values.swift b/Modules/Sensors/values.swift index b47a7fbc..6e2e2c18 100644 --- a/Modules/Sensors/values.swift +++ b/Modules/Sensors/values.swift @@ -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) ]