From 4f45b61bb94fef6533c74efe99b896314e210e1e Mon Sep 17 00:00:00 2001 From: Dinko Korunic Date: Wed, 2 Oct 2024 18:23:24 +0200 Subject: [PATCH] Add missing sensor values (#23) --- Taskfile.yml | 5 +++++ smc/sensors.go | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ src/power.txt | 1 + src/temp.txt | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 103 insertions(+) diff --git a/Taskfile.yml b/Taskfile.yml index ee95bac..21aafe8 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -42,8 +42,13 @@ tasks: - gofumpt -l -w . - betteralign -apply ./... + generate: + cmds: + - go generate ./smc + build: cmds: + - task: generate - task: fmt - go build -trimpath -pgo=auto -ldflags="-s -w -X main.GitTag={{.GIT_LAST_TAG}} -X main.GitCommit={{.GIT_HEAD_COMMIT}} -X main.GitDirty={{.GIT_MODIFIED}} -X main.BuildTime={{.BUILD_DATE}}" -o {{.TARGET}} diff --git a/smc/sensors.go b/smc/sensors.go index b61bc99..c084e86 100644 --- a/smc/sensors.go +++ b/smc/sensors.go @@ -62,6 +62,54 @@ var AppleTemp = []SensorStat{ {Key: "Tg0D", Desc: "GPU 2"}, {Key: "Tg0L", Desc: "GPU 3"}, {Key: "Tg0T", Desc: "GPU 4"}, + {Key: "Tm02", Desc: "Memory 1"}, + {Key: "Tm06", Desc: "Memory 2"}, + {Key: "Tm08", Desc: "Memory 3"}, + {Key: "Tm09", Desc: "Memory 4"}, + {Key: "Tp1h", Desc: "CPU Efficiency Core 1"}, + {Key: "Tp1t", Desc: "CPU Efficiency Core 2"}, + {Key: "Tp1p", Desc: "CPU Efficiency Core 3"}, + {Key: "Tp1l", Desc: "CPU Efficiency Core 4"}, + {Key: "Tp01", Desc: "CPU Performance Core 1"}, + {Key: "Tp05", Desc: "CPU Performance Core 2"}, + {Key: "Tp09", Desc: "CPU Performance Core 3"}, + {Key: "Tp0D", Desc: "CPU Performance Core 4"}, + {Key: "Tp0X", Desc: "CPU Performance Core 5"}, + {Key: "Tp0b", Desc: "CPU Performance Core 6"}, + {Key: "Tp0f", Desc: "CPU Performance Core 7"}, + {Key: "Tp0j", Desc: "CPU Performance Core 8"}, + {Key: "Tg0f", Desc: "GPU 1"}, + {Key: "Tg0j", Desc: "GPU 2"}, + {Key: "Te05", Desc: "CPU Efficiency Core 1"}, + {Key: "Te0L", Desc: "CPU Efficiency Core 2"}, + {Key: "Te0P", Desc: "CPU Efficiency Core 3"}, + {Key: "Te0S", Desc: "CPU Efficiency Core 4"}, + {Key: "Tf04", Desc: "CPU Performance Core 1"}, + {Key: "Tf09", Desc: "CPU Performance Core 2"}, + {Key: "Tf0A", Desc: "CPU Performance Core 3"}, + {Key: "Tf0B", Desc: "CPU Performance Core 4"}, + {Key: "Tf0D", Desc: "CPU Performance Core 5"}, + {Key: "Tf0E", Desc: "CPU Performance Core 6"}, + {Key: "Tf44", Desc: "CPU Performance Core 7"}, + {Key: "Tf49", Desc: "CPU Performance Core 8"}, + {Key: "Tf4A", Desc: "CPU Performance Core 9"}, + {Key: "Tf4B", Desc: "CPU Performance Core 10"}, + {Key: "Tf4D", Desc: "CPU Performance Core 11"}, + {Key: "Tf4E", Desc: "CPU Performance Core 12"}, + {Key: "Tf14", Desc: "GPU 1"}, + {Key: "Tf18", Desc: "GPU 2"}, + {Key: "Tf19", Desc: "GPU 3"}, + {Key: "Tf1A", Desc: "GPU 4"}, + {Key: "Tf24", Desc: "GPU 5"}, + {Key: "Tf28", Desc: "GPU 6"}, + {Key: "Tf29", Desc: "GPU 7"}, + {Key: "Tf2A", Desc: "GPU 8"}, + {Key: "TaLP", Desc: "Airflow Left"}, + {Key: "TaRF", Desc: "Airflow Right"}, + {Key: "TH0x", Desc: "NAND"}, + {Key: "TB1T", Desc: "Battery 1"}, + {Key: "TB2T", Desc: "Battery 2"}, + {Key: "TW0P", Desc: "Airport"}, {Key: "TaLP", Desc: "Airflow Left"}, {Key: "TaRF", Desc: "Airflow Right"}, {Key: "TH0x", Desc: "NAND"}, @@ -339,6 +387,7 @@ var ApplePower = []SensorStat{ {Key: "PZHD", Desc: "SSD"}, {Key: "PZOD", Desc: "ODD(PZOD)"}, {Key: "Pc0R", Desc: "Average Main Chipset"}, + {Key: "PDBR", Desc: "Power Delivery Brightness"}, } var AppleVoltage = []SensorStat{ diff --git a/src/power.txt b/src/power.txt index f6136f7..372c16a 100644 --- a/src/power.txt +++ b/src/power.txt @@ -124,3 +124,4 @@ Memory:PZDM SSD:PZHD ODD(PZOD):PZOD Average Main Chipset:Pc0R +Power Delivery Brightness:PDBR diff --git a/src/temp.txt b/src/temp.txt index 5a42ae3..1844968 100644 --- a/src/temp.txt +++ b/src/temp.txt @@ -40,6 +40,54 @@ GPU 1:Tg05 GPU 2:Tg0D GPU 3:Tg0L GPU 4:Tg0T +Memory 1:Tm02 +Memory 2:Tm06 +Memory 3:Tm08 +Memory 4:Tm09 +CPU Efficiency Core 1:Tp1h +CPU Efficiency Core 2:Tp1t +CPU Efficiency Core 3:Tp1p +CPU Efficiency Core 4:Tp1l +CPU Performance Core 1:Tp01 +CPU Performance Core 2:Tp05 +CPU Performance Core 3:Tp09 +CPU Performance Core 4:Tp0D +CPU Performance Core 5:Tp0X +CPU Performance Core 6:Tp0b +CPU Performance Core 7:Tp0f +CPU Performance Core 8:Tp0j +GPU 1:Tg0f +GPU 2:Tg0j +CPU Efficiency Core 1:Te05 +CPU Efficiency Core 2:Te0L +CPU Efficiency Core 3:Te0P +CPU Efficiency Core 4:Te0S +CPU Performance Core 1:Tf04 +CPU Performance Core 2:Tf09 +CPU Performance Core 3:Tf0A +CPU Performance Core 4:Tf0B +CPU Performance Core 5:Tf0D +CPU Performance Core 6:Tf0E +CPU Performance Core 7:Tf44 +CPU Performance Core 8:Tf49 +CPU Performance Core 9:Tf4A +CPU Performance Core 10:Tf4B +CPU Performance Core 11:Tf4D +CPU Performance Core 12:Tf4E +GPU 1:Tf14 +GPU 2:Tf18 +GPU 3:Tf19 +GPU 4:Tf1A +GPU 5:Tf24 +GPU 6:Tf28 +GPU 7:Tf29 +GPU 8:Tf2A +Airflow Left:TaLP +Airflow Right:TaRF +NAND:TH0x +Battery 1:TB1T +Battery 2:TB2T +Airport:TW0P Airflow Left:TaLP Airflow Right:TaRF NAND:TH0x