From d3760eaf37468a33d90b2e812bfcf6de06711a94 Mon Sep 17 00:00:00 2001 From: shadeyg56 <31134255+shadeyg56@users.noreply.github.com> Date: Mon, 23 Oct 2023 21:19:45 -0500 Subject: [PATCH] skip temp sensor that report as 0 --- auto_cpufreq/core.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/auto_cpufreq/core.py b/auto_cpufreq/core.py index 6ebfc27..f0602fd 100755 --- a/auto_cpufreq/core.py +++ b/auto_cpufreq/core.py @@ -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