Skip to content

fix: prioritize reliable thermal sensors over acpitz#192

Open
CoRfr wants to merge 1 commit intoleukipp:developfrom
CoRfr:fix/processor-temperature-priority
Open

fix: prioritize reliable thermal sensors over acpitz#192
CoRfr wants to merge 1 commit intoleukipp:developfrom
CoRfr:fix/processor-temperature-priority

Conversation

@CoRfr
Copy link
Copy Markdown

@CoRfr CoRfr commented Mar 17, 2026

Summary

  • Prioritize more reliable thermal sensors (x86_pkg_temp, k10temp, cpu-thermal) over acpitz
  • Filter out obviously invalid temperature readings (outside -40°C to 150°C range)

Problem

getProcessorTemperature() returns the first matching thermal zone, which on some hardware (e.g. Surface Pro 3) is acpitz reporting -269°C. Meanwhile x86_pkg_temp on the same device correctly reports ~46°C.

$ for zone in /sys/class/thermal/thermal_zone*; do
    echo "$(cat $zone/type): $(cat $zone/temp)"
  done
acpitz: -268800
x86_pkg_temp: 46000

Fix

Instead of returning the first match, iterate all zones and select the one with the highest priority. acpitz is kept as a last-resort fallback but only if its value is within a sane range.

🤖 Generated with Claude Code

acpitz can report invalid temperatures (e.g. -269°C on Surface Pro 3).
Prioritize x86_pkg_temp, k10temp, cpu-thermal, soc_dts0, PNIT over
acpitz, and filter out values outside the -40°C to 150°C range.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@CoRfr CoRfr force-pushed the fix/processor-temperature-priority branch from aa3b9ee to b88add6 Compare March 17, 2026 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant