From 3218fd395e48351850c87cd0b42664c2d8c9c72f Mon Sep 17 00:00:00 2001 From: Joe Roback Date: Thu, 14 Nov 2024 09:26:15 -0700 Subject: [PATCH] Handle dev.pchtherm temperatures in the thermal dashboard widget --- .../OPNsense/Diagnostics/Api/SystemController.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/opnsense/mvc/app/controllers/OPNsense/Diagnostics/Api/SystemController.php b/src/opnsense/mvc/app/controllers/OPNsense/Diagnostics/Api/SystemController.php index 932c0bc26f8..a1058a5c528 100644 --- a/src/opnsense/mvc/app/controllers/OPNsense/Diagnostics/Api/SystemController.php +++ b/src/opnsense/mvc/app/controllers/OPNsense/Diagnostics/Api/SystemController.php @@ -240,13 +240,16 @@ public function systemTemperatureAction() $tempItem['temperature'] = trim(str_replace('C', '', $value)); $tempItem['type_translated'] = gettext('CPU'); $tempItem['type'] = 'cpu'; - if (strpos($tempItem['device'], 'hw.acpi') !== false) { + if (str_starts_with($tempItem['device'], 'hw.acpi') !== false) { $tempItem['type_translated'] = gettext('Zone'); $tempItem['type'] = 'zone'; /* XXX may or may not be a good idea */ - } elseif (strpos($tempItem['device'], 'dev.amdtemp') !== false) { + } elseif (str_starts_with($tempItem['device'], 'dev.amdtemp') !== false) { $tempItem['type_translated'] = gettext('AMD'); $tempItem['type'] = 'amd'; + } else if (str_starts_with($tempItem['device'], 'dev.pchtherm') !== false) { + $tempItem['type'] = 'pch'; + $tempItem['type_translated'] = gettext('Platform'); } $result[] = $tempItem; }