Skip to content

Conversation

@fflewddur
Copy link
Owner

  • Add logic to find temperature sensors for Intel Core CPUs pre-Sandybidge.
  • Add console error messages for known temperature modules that fail to find any sensors.

- Add logic to find temperature sensors for Intel
  Core CPUs pre-Sandybidge.
- Add console error messages for known temperature
  modules that fail to find any sensors.
@fflewddur fflewddur requested a review from Copilot May 27, 2025 20:28
@fflewddur fflewddur linked an issue May 27, 2025 that may be closed by this pull request
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Enhance temperature sensor detection by adding fallbacks for older Intel Core chips and error logging when sensors are missing.

  • Coretemp branch now checks both temp1_label/temp2_label and temp1_input/temp2_input, logging errors on failure.
  • k10temp and zenpower branches gain similar existence checks and error messages.
Comments suppressed due to low confidence (2)

src/extension.ts:98

  • [nitpick] The variable name f is vague; consider renaming it to labelFile or similar for clarity.
let f = new File(`${base}${filename}/temp1_label`);

src/extension.ts:99

  • Add unit tests for the new fallback paths (pre-Sandybridge labels/inputs) and the error branches to ensure these cases are covered.
if (!f.exists()) {

f = new File(`${base}${filename}/temp2_label`);
}
if (!f.exists()) {
console.error(`[TopHat] Found coretemp but no sensor labels`);
Copy link

Copilot AI May 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Include the full path (base and filename) in this error message to make debugging easier.

Suggested change
console.error(`[TopHat] Found coretemp but no sensor labels`);
console.error(`[TopHat] Found coretemp but no sensor labels in ${base}${filename}`);

Copilot uses AI. Check for mistakes.
}
if (!f.exists()) {
console.error(`[TopHat] Found coretemp but no sensor labels`);
return;
Copy link

Copilot AI May 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using return here exits the entire function, which may skip detection of other sensors; consider continuing to the next iteration instead.

Copilot uses AI. Check for mistakes.
@fflewddur fflewddur merged commit cbd15fa into main May 27, 2025
5 checks passed
@fflewddur fflewddur deleted the sandybridge-temp branch May 27, 2025 20:31
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.

CPU temperature showing as n/a due to hardcoded temp1_* for Intel

2 participants