K10temp (#73)
* fixed temperature for AMD * fixes #72 * wrapped into try...except block
This commit is contained in:
parent
e7c7e39d62
commit
b55c61574c
|
@ -477,10 +477,17 @@ def sysinfo():
|
||||||
print("\nTemperature for each physical core:\n")
|
print("\nTemperature for each physical core:\n")
|
||||||
core_num = 0
|
core_num = 0
|
||||||
while core_num < core_temp_num:
|
while core_num < core_temp_num:
|
||||||
|
temp = float("nan")
|
||||||
|
try:
|
||||||
if "coretemp" in core_temp:
|
if "coretemp" in core_temp:
|
||||||
temp = core_temp['coretemp'][core_num].current
|
temp = core_temp['coretemp'][core_num].current
|
||||||
else:
|
elif "k10temp" in core_temp:
|
||||||
|
# https://www.kernel.org/doc/Documentation/hwmon/k10temp
|
||||||
|
temp = core_temp['k10temp'].current
|
||||||
|
elif "acpitz" in core_temp:
|
||||||
temp = core_temp['acpitz'][0].current
|
temp = core_temp['acpitz'][0].current
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
print(f"CPU{core_num} temp: {temp:.0f}°C")
|
print(f"CPU{core_num} temp: {temp:.0f}°C")
|
||||||
core_num += 1
|
core_num += 1
|
||||||
|
|
Loading…
Reference in New Issue