feat: added spa5 type to the SMC and a few new power sensors (#2161)

This commit is contained in:
Serhiy Mytrovtsiy
2024-10-05 17:31:41 +02:00
parent a1ebc792d6
commit ce92471f6c
4 changed files with 10 additions and 3 deletions

View File

@@ -480,13 +480,16 @@ internal let SensorsList: [Sensor] = [
Sensor(key: "PCEC", name: "CPU VccEDRAM", group: .CPU, type: .power, platforms: Platform.all),
Sensor(key: "PCPG", name: "GPU Intel Graphics", group: .GPU, type: .power, platforms: Platform.all),
Sensor(key: "PG0R", name: "GPU", group: .GPU, type: .power, platforms: Platform.all),
Sensor(key: "PG0C", name: "GPU", group: .GPU, type: .power, platforms: Platform.all),
Sensor(key: "PG0R", name: "GPU 1", group: .GPU, type: .power, platforms: Platform.all),
Sensor(key: "PG1R", name: "GPU 2", group: .GPU, type: .power, platforms: Platform.all),
Sensor(key: "PCGC", name: "Intel GPU", group: .GPU, type: .power, platforms: Platform.all),
Sensor(key: "PCGM", name: "Intel GPU (IMON)", group: .GPU, type: .power, platforms: Platform.all),
Sensor(key: "PC3C", name: "RAM", group: .sensor, type: .power, platforms: Platform.all),
Sensor(key: "PPBR", name: "Battery", group: .sensor, type: .power, platforms: Platform.all),
Sensor(key: "PDTR", name: "DC In", group: .sensor, type: .power, platforms: Platform.all),
Sensor(key: "PMTR", name: "Memory Total", group: .sensor, type: .power, platforms: Platform.all),
Sensor(key: "PSTR", name: "System Total", group: .sensor, type: .power, platforms: Platform.all),
Sensor(key: "PDBR", name: "Power Delivery Brightness", group: .sensor, type: .power, platforms: [.m1, .m1Pro, .m1Max, .m1Ultra])

View File

@@ -20,6 +20,7 @@ internal enum SMCDataType: String {
case SP3C = "sp3c"
case SP4B = "sp5b"
case SP5A = "sp5a"
case SPA5 = "spa5"
case SP69 = "sp669"
case SP78 = "sp78"
case SP87 = "sp87"
@@ -239,6 +240,9 @@ public class SMC {
case SMCDataType.SP96.rawValue:
let intValue: Double = Double(Int(val.bytes[0]) * 256 + Int(val.bytes[1]))
return Double(intValue / 64)
case SMCDataType.SPA5.rawValue:
let result: Double = Double(UInt16(val.bytes[0]) * 256 + UInt16(val.bytes[1]))
return Double(result / 32)
case SMCDataType.SPB4.rawValue:
let intValue: Double = Double(Int(val.bytes[0]) * 256 + Int(val.bytes[1]))
return Double(intValue / 16)

View File

@@ -17,7 +17,7 @@
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>600</string>
<string>601</string>
<key>Description</key>
<string>Simple macOS system monitor in your menu bar</string>
<key>LSApplicationCategoryType</key>

View File

@@ -13,7 +13,7 @@
<key>CFBundleShortVersionString</key>
<string>2.11.13</string>
<key>CFBundleVersion</key>
<string>600</string>
<string>601</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>