Skip to content
This repository has been archived by the owner on Aug 29, 2020. It is now read-only.

Commit

Permalink
Don't sensor with a temp of 0
Browse files Browse the repository at this point in the history
  • Loading branch information
cjbassi committed Nov 30, 2018
1 parent 7da570d commit ce5342c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/widgets/temp_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
2 changes: 1 addition & 1 deletion src/widgets/temp_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion src/widgets/temp_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}

0 comments on commit ce5342c

Please sign in to comment.