From ce5342cfc9e15ae0177f0fa9e69a33fa8ba10070 Mon Sep 17 00:00:00 2001 From: Caleb Bassi Date: Thu, 29 Nov 2018 17:37:41 -0800 Subject: [PATCH] Don't sensor with a temp of 0 --- src/widgets/temp_darwin.go | 4 +++- src/widgets/temp_linux.go | 2 +- src/widgets/temp_windows.go | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/widgets/temp_darwin.go b/src/widgets/temp_darwin.go index d635dd7..c5f246c 100644 --- a/src/widgets/temp_darwin.go +++ b/src/widgets/temp_darwin.go @@ -52,6 +52,8 @@ func SensorsTemperatures() ([]TemperatureStat, error) { func (self *Temp) update() { sensors, _ := SensorsTemperatures() for _, sensor := range sensors { - self.Data[sensor.SensorKey] = int(sensor.Temperature) + if sensor.Temperature != 0 { + self.Data[sensor.SensorKey] = int(sensor.Temperature) + } } } diff --git a/src/widgets/temp_linux.go b/src/widgets/temp_linux.go index e818863..781288e 100644 --- a/src/widgets/temp_linux.go +++ b/src/widgets/temp_linux.go @@ -10,7 +10,7 @@ func (self *Temp) update() { sensors, _ := psHost.SensorsTemperatures() for _, sensor := range sensors { // only sensors with input in their name are giving us live temp info - if strings.Contains(sensor.SensorKey, "input") { + if strings.Contains(sensor.SensorKey, "input") && sensor.Temperature != 0 { // removes '_input' from the end of the sensor name label := sensor.SensorKey[:strings.Index(sensor.SensorKey, "_input")] self.Data[label] = int(sensor.Temperature) diff --git a/src/widgets/temp_windows.go b/src/widgets/temp_windows.go index 99c2a87..e6dbb46 100644 --- a/src/widgets/temp_windows.go +++ b/src/widgets/temp_windows.go @@ -7,6 +7,8 @@ import ( func (self *Temp) update() { sensors, _ := psHost.SensorsTemperatures() for _, sensor := range sensors { - self.Data[sensor.SensorKey] = int(sensor.Temperature) + if sensor.Temperature != 0 { + self.Data[sensor.SensorKey] = int(sensor.Temperature) + } } }