Skip to content

Commit

Permalink
temperature sensors: add low value from ..._min file
Browse files Browse the repository at this point in the history
add an optional low value from the ./*_min file.

```
temp[1-*]_min	Temperature min value.
		Unit: millidegree Celsius
		RW
```

Signed-off-by: Sven Nierlein <[email protected]>
  • Loading branch information
sni committed Jan 26, 2024
1 parent 65b5fa3 commit cc438c5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions host/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ type UserStat struct {
type TemperatureStat struct {
SensorKey string `json:"sensorKey"`
Temperature float64 `json:"temperature"`
Low float64 `json:"sensorLow"`
High float64 `json:"sensorHigh"`
Critical float64 `json:"sensorCritical"`
}
Expand Down
1 change: 1 addition & 0 deletions host/host_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,7 @@ func SensorsTemperaturesWithContext(ctx context.Context) ([]TemperatureStat, err
temperatures = append(temperatures, TemperatureStat{
SensorKey: name,
Temperature: temperature / hostTemperatureScale,
Low: optionalValueReadFromFile(basepath+"_min") / hostTemperatureScale,
High: optionalValueReadFromFile(basepath+"_max") / hostTemperatureScale,
Critical: optionalValueReadFromFile(basepath+"_crit") / hostTemperatureScale,
})
Expand Down

0 comments on commit cc438c5

Please sign in to comment.