summaryrefslogtreecommitdiffstats
path: root/devices/temp_darwin.go
diff options
context:
space:
mode:
Diffstat (limited to 'devices/temp_darwin.go')
-rw-r--r--devices/temp_darwin.go16
1 files changed, 13 insertions, 3 deletions
diff --git a/devices/temp_darwin.go b/devices/temp_darwin.go
index fe98fc2..37559d1 100644
--- a/devices/temp_darwin.go
+++ b/devices/temp_darwin.go
@@ -6,7 +6,7 @@ import smc "github.com/xxxserxxx/iSMC"
func init() {
RegisterTemp(update)
- RegisterDeviceList(Temperatures, devs)
+ RegisterDeviceList(Temperatures, devs, defs)
ts = make(map[string]float32)
}
@@ -25,8 +25,6 @@ func update(temps map[string]int) map[string]error {
return nil
}
-// TODO: Set reasonable default devices
-// CPU (TC[01]P), GPU (TG0P), Memory (Ts0S) and Disk (TH0P)
func devs() []string {
rv := make([]string, len(smc.AppleTemp))
for i, v := range smc.AppleTemp {
@@ -34,3 +32,15 @@ func devs() []string {
}
return rv
}
+
+func defs() []string {
+ // CPU 0 CPU 1 GPU Memory Disk
+ ids := map[string]bool{"TC0P": true, "TC1P": true, "TG0P": true, "Ts0S": true, "TH0P": true}
+ rv := make([]string, 0, len(ids))
+ for _, v := range smc.AppleTemp {
+ if ids[v.Key] {
+ rv = append(rv, v.Desc)
+ }
+ }
+ return rv
+}