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

View File

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