mirror of
https://github.com/AdnanHodzic/auto-cpufreq.git
synced 2025-07-21 12:45:03 +02:00
check for CPU lable if no coretemp (#513)
Attempt to use "CPU" label before falling back to the first sensor.
This commit is contained in:
parent
717ab2d462
commit
b1758ba74b
@ -1156,8 +1156,19 @@ def sysinfo():
|
|||||||
cpu_temp_index = core_temp_labels.index(f"Core {core}")
|
cpu_temp_index = core_temp_labels.index(f"Core {core}")
|
||||||
temp_per_cpu[i] = core_temp["coretemp"][cpu_temp_index].current
|
temp_per_cpu[i] = core_temp["coretemp"][cpu_temp_index].current
|
||||||
else:
|
else:
|
||||||
temp = list(psutil.sensors_temperatures())
|
# iterate over all sensors
|
||||||
temp_per_cpu = [core_temp[temp[0]][0].current] * online_cpu_count
|
for sensor in core_temp:
|
||||||
|
# iterate over all temperatures in the current sensor
|
||||||
|
for temp in core_temp[sensor]:
|
||||||
|
if temp.label == 'CPU':
|
||||||
|
temp_per_cpu = [temp.current] * online_cpu_count
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
continue
|
||||||
|
break
|
||||||
|
else: # if 'CPU' label not found in any sensor, use first available temperature
|
||||||
|
temp = list(core_temp.keys())[0]
|
||||||
|
temp_per_cpu = [core_temp[temp][0].current] * online_cpu_count
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(repr(e))
|
print(repr(e))
|
||||||
pass
|
pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user