diff options
author | Sean E. Russell <ser@ser1.net> | 2020-04-23 10:41:20 -0500 |
---|---|---|
committer | Sean E. Russell <ser@ser1.net> | 2020-04-23 10:41:20 -0500 |
commit | 5ada5315d940038fcd83777b1e73797bbbada108 (patch) | |
tree | 14af5297197ecc43e50ff7cafa8154fda55dd72f /devices/temp_openbsd.go | |
parent | 3fcab5a42054c84895c4f6da5097360d35414fde (diff) |
Fixes #92, configurable temps; help text & docs clean-up; versions are now built into binaries at compile time; clean up old extensions params; adds --list command; adds --write-config command; fixes bug in colorscheme loading; fixes bug in Colorschemes -- all had empty Name attrs; adds ability to list devices.
Diffstat (limited to 'devices/temp_openbsd.go')
-rw-r--r-- | devices/temp_openbsd.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/devices/temp_openbsd.go b/devices/temp_openbsd.go index 410cc4a..d889d78 100644 --- a/devices/temp_openbsd.go +++ b/devices/temp_openbsd.go @@ -15,6 +15,7 @@ import ( "unsafe" ) +// TODO: Add filtering. Getting the temperature sensor names is non-trivial for OpenBSD, and until I can test it, leave it unimplemented func init() { RegisterTemp(update) } @@ -66,7 +67,9 @@ func getTemp(temps map[string]int, mib []C.int, mlen int, snsrdev *C.struct_sens key := C.GoString(&snsrdev.xname[0]) + ".temp" + strconv.Itoa(index) temp := int((snsr.value - 273150000.0) / 1000000.0) - temps[key] = temp + if _, ok := temps[key]; ok { + temps[key] = temp + } } } } |