Merge pull request #219 from aztecrabbit/fix-issue-16
Fix temperature widget not working
This commit is contained in:
commit
b0fd8ac8cd
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build linux || darwin
|
||||||
// +build linux darwin
|
// +build linux darwin
|
||||||
|
|
||||||
package devices
|
package devices
|
||||||
|
@ -15,8 +16,12 @@ func init() {
|
||||||
func getTemps(temps map[string]int) map[string]error {
|
func getTemps(temps map[string]int) map[string]error {
|
||||||
sensors, err := host.SensorsTemperatures()
|
sensors, err := host.SensorsTemperatures()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if _, ok := err.(*host.Warnings); ok {
|
||||||
|
// ignore warnings
|
||||||
|
} else {
|
||||||
return map[string]error{"gopsutil host": err}
|
return map[string]error{"gopsutil host": err}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for _, sensor := range sensors {
|
for _, sensor := range sensors {
|
||||||
label := sensorMap[sensor.SensorKey]
|
label := sensorMap[sensor.SensorKey]
|
||||||
if _, ok := temps[label]; ok {
|
if _, ok := temps[label]; ok {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user