fix windows sensor mocks and data directory tests

This commit is contained in:
henrygd
2026-08-26 11:50:19 -04:00
parent 0bc5470f08
commit 0ad707288a
3 changed files with 19 additions and 7 deletions

View File

@@ -214,9 +214,12 @@ func (lhm *lhmProcess) getTemps(ctx context.Context) (temps []sensors.Temperatur
return temps, nil
}
// getSensorTemps attempts to pull sensor temperatures from the embedded LHM process.
// getSensorTemps is a variable so tests can replace the platform sensor collector.
var getSensorTemps = getWindowsSensorTemps
// getWindowsSensorTemps attempts to pull sensor temperatures from the embedded LHM process.
// NB: LibreHardwareMonitorLib requires admin privileges to access all available sensors.
func getSensorTemps(ctx context.Context) (temps []sensors.TemperatureStat, err error) {
func getWindowsSensorTemps(ctx context.Context) (temps []sensors.TemperatureStat, err error) {
defer func() {
if err != nil {
slog.Debug("Error reading sensors", "err", err)