Skip to content

Commit

Permalink
Handle dev.pchtherm temperatures in the thermal dashboard widget
Browse files Browse the repository at this point in the history
  • Loading branch information
joeroback committed Nov 14, 2024
1 parent 5f533d4 commit f037a76
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,16 @@ public function systemTemperatureAction()
$tempItem['device'] = $parts[0];
$tempItem['device_seq'] = filter_var($tempItem['device'], FILTER_SANITIZE_NUMBER_INT);
$tempItem['temperature'] = trim(str_replace('C', '', $parts[1]));
$tempItem['type'] = strpos($tempItem['device'], 'hw.acpi') !== false ? 'zone' : 'cpu';
$tempItem['type_translated'] = $tempItem['type'] == 'zone' ? gettext('Zone') : gettext('CPU');
if (str_starts_with($tempItem['device'], 'hw.acpi')) {
$tempItem['type'] = 'zone';
$tempItem['type_translated'] = gettext('Zone');
} else if (str_starts_with($tempItem['device'], 'dev.pchtherm')) {
$tempItem['type'] = 'pch';
$tempItem['type_translated'] = gettext('Platform');
} else {
$tempItem['type'] = 'cpu';
$tempItem['type_translated'] = gettext('CPU');
}
$result[] = $tempItem;
}
}
Expand Down

0 comments on commit f037a76

Please sign in to comment.