Skip to content

Commit

Permalink
Restore min and alarm properties on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
srebhan committed Oct 31, 2023
1 parent a7e2bdf commit 37484a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions host/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ 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"`
Alarm float64 `json:"sensorAlarm"`
}

func (h InfoStat) String() string {
Expand Down
2 changes: 2 additions & 0 deletions host/host_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -493,8 +493,10 @@ 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,
Alarm: optionalValueReadFromFile(basepath+"_alarm") / hostTemperatureScale,
})
}

Expand Down

0 comments on commit 37484a7

Please sign in to comment.