硬件信息
- 主板: 技嘉 G1.Sniper A88X-CF
- 传感器: ITE IT8620E
- CPU: AMD A10-7850K
问题描述
原生驱动无法正确识别温度传感器,导致显示错误温度
解决方案
- 添加备用温度源支持
- 允许自定义温度源路径
- 增加IT8620传感器支持
技术实现
// 温度读取逻辑优化
function getC**mperature() {
const sources = [
'/var/run/fn_cpu_temp', // 自定义源
'/sys/class/hwmon/hwmon0/temp1_input', // IT8620
'/sys/class/hwmon/hwmon1/temp1_input' // k10temp
];
for (const source of sources) {
try {
const data = fs.readFileSync(source, 'utf8');
const temp = source.endsWith('_input') ?
Math.round(parseInt(data)/1000) :
parseInt(data.match(/CPU_TEMP=(\d+)/)[1]);
if (temp > 10 && temp < 100) return temp;
} catch (e) {
continue;
}
}
return 0;
}
以上是通过deep seek得出的结论,希望技术大大能处理下
