From 37484a7b5969ff5de67eb05629175132622cb9ed Mon Sep 17 00:00:00 2001 From: Sven Rebhan Date: Tue, 31 Oct 2023 15:40:03 +0100 Subject: [PATCH] Restore min and alarm properties on Linux --- host/host.go | 2 ++ host/host_linux.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/host/host.go b/host/host.go index c7e84e3a5..a312eda9b 100644 --- a/host/host.go +++ b/host/host.go @@ -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 { diff --git a/host/host_linux.go b/host/host_linux.go index f9d7995e7..ef736db22 100644 --- a/host/host_linux.go +++ b/host/host_linux.go @@ -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, }) }