kopia lustrzana https://github.com/cyoung/stratux
fix from unexpected case wehre device stores CPU temp as simple integer (eg 53 vs 53000 for 50.0C
rodzic
1465ba1a37
commit
98795f3da1
|
@ -449,7 +449,11 @@ func cpuTempMonitor() {
|
|||
if err == nil {
|
||||
tInt, err := strconv.Atoi(tempStr)
|
||||
if err == nil {
|
||||
globalStatus.CPUTemp = float32(tInt) / float32(1000.0)
|
||||
if tInt > 1000 {
|
||||
globalStatus.CPUTemp = float32(tInt) / float32(1000.0)
|
||||
} else {
|
||||
globalStatus.CPUTemp = float32(tInt) // case where Temp is returned as simple integer
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue