fix: append HID sensors keys to average sensors list when for macs with M1 (#892)

This commit is contained in:
Serhiy Mytrovtsiy
2022-03-29 20:14:07 +02:00
parent 5ed55830ca
commit 41a4dd6385

View File

@@ -116,8 +116,8 @@ internal class SensorsReader: Reader<[Sensor_p]> {
}
}
cpuSensors = list.filter({ $0.key.hasPrefix("pACC MTR Temp") || $0.key.hasPrefix("eACC MTR Temp") }).map{ $0.value }
gpuSensors = list.filter({ $0.key.hasPrefix("GPU MTR Temp") }).map{ $0.value }
cpuSensors += self.list.filter({ $0.key.hasPrefix("pACC MTR Temp") || $0.key.hasPrefix("eACC MTR Temp") }).map{ $0.value }
gpuSensors += self.list.filter({ $0.key.hasPrefix("GPU MTR Temp") }).map{ $0.value }
}
#endif
@@ -304,8 +304,16 @@ internal class SensorsReader: Reader<[Sensor_p]> {
private func initCalculatedSensors() -> [Sensor] {
var list: [Sensor] = []
let cpuSensors = self.list.filter({ $0.group == .CPU && $0.type == .temperature && $0.average }).map{ $0.value }
let gpuSensors = self.list.filter({ $0.group == .GPU && $0.type == .temperature && $0.average }).map{ $0.value }
var cpuSensors = self.list.filter({ $0.group == .CPU && $0.type == .temperature && $0.average }).map{ $0.value }
var gpuSensors = self.list.filter({ $0.group == .GPU && $0.type == .temperature && $0.average }).map{ $0.value }
#if arch(arm64)
if self.HIDState {
cpuSensors += list.filter({ $0.key.hasPrefix("pACC MTR Temp") || $0.key.hasPrefix("eACC MTR Temp") }).map{ $0.value }
gpuSensors += list.filter({ $0.key.hasPrefix("GPU MTR Temp") }).map{ $0.value }
}
#endif
let fanSensors = self.list.filter({ $0.type == .fan && !$0.isComputed }).map{ $0.value}
if !cpuSensors.isEmpty {