From cc438c55027b1b5ff50ea7e9002f23af18cef8c5 Mon Sep 17 00:00:00 2001 From: Sven Nierlein Date: Fri, 26 Jan 2024 16:11:58 +0100 Subject: [PATCH] temperature sensors: add low value from ..._min file add an optional low value from the ./*_min file. ``` temp[1-*]_min Temperature min value. Unit: millidegree Celsius RW ``` Signed-off-by: Sven Nierlein --- host/host.go | 1 + host/host_linux.go | 1 + 2 files changed, 2 insertions(+) diff --git a/host/host.go b/host/host.go index ee9486369..6e8e369cf 100644 --- a/host/host.go +++ b/host/host.go @@ -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"` } diff --git a/host/host_linux.go b/host/host_linux.go index 5d4c1a90f..04847126e 100644 --- a/host/host_linux.go +++ b/host/host_linux.go @@ -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, })