skip temp sensor that report as 0

This commit is contained in:
shadeyg56 2023-10-23 21:19:45 -05:00 committed by GitHub
parent 98cd5dd31f
commit d3760eaf37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 6 deletions

View File

@ -1235,16 +1235,18 @@ def sysinfo():
# iterate over all temperatures in the current sensor
for temp in temp_sensors[sensor]:
if 'CPU' in temp.label:
temp_per_cpu = [temp.current] * online_cpu_count
break
if temp.current != 0:
temp_per_cpu = [temp.current] * online_cpu_count
break
else:
continue
break
else:
if "acpitz" in temp_sensors:
temp_per_cpu = [temp_sensors["acpitz"][0].current] * online_cpu_count
elif "k10temp" in temp_sensors:
temp_per_cpu = [temp_sensors["k10temp"][0].current] * online_cpu_count
for sensor in ["acpitz", "k10temp"]:
if sensor in temp_sensors:
if temp_sensors[sensor][0].current != 0:
temp_per_cpu = [temp_sensors[sensor][0].current] * online_cpu_count
break;
except Exception as e:
print(repr(e))
pass