From ce92471f6c30dbf6d6cd7143e1aa503df684d58c Mon Sep 17 00:00:00 2001 From: Serhiy Mytrovtsiy Date: Sat, 5 Oct 2024 17:31:41 +0200 Subject: [PATCH] feat: added spa5 type to the SMC and a few new power sensors (#2161) --- Modules/Sensors/values.swift | 5 ++++- SMC/smc.swift | 4 ++++ Stats/Supporting Files/Info.plist | 2 +- Widgets/Supporting Files/Info.plist | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Modules/Sensors/values.swift b/Modules/Sensors/values.swift index 53e57e36..367ec4b5 100644 --- a/Modules/Sensors/values.swift +++ b/Modules/Sensors/values.swift @@ -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]) diff --git a/SMC/smc.swift b/SMC/smc.swift index 84f9a50c..dc42e72e 100644 --- a/SMC/smc.swift +++ b/SMC/smc.swift @@ -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) diff --git a/Stats/Supporting Files/Info.plist b/Stats/Supporting Files/Info.plist index 07b1ad51..056efef0 100755 --- a/Stats/Supporting Files/Info.plist +++ b/Stats/Supporting Files/Info.plist @@ -17,7 +17,7 @@ CFBundleShortVersionString $(MARKETING_VERSION) CFBundleVersion - 600 + 601 Description Simple macOS system monitor in your menu bar LSApplicationCategoryType diff --git a/Widgets/Supporting Files/Info.plist b/Widgets/Supporting Files/Info.plist index 2eb7d3b2..90e554b2 100644 --- a/Widgets/Supporting Files/Info.plist +++ b/Widgets/Supporting Files/Info.plist @@ -13,7 +13,7 @@ CFBundleShortVersionString 2.11.13 CFBundleVersion - 600 + 601 NSExtension NSExtensionPointIdentifier