From 0cbc48d526a7b81bfec683c191fad669f624f124 Mon Sep 17 00:00:00 2001 From: seerge Date: Wed, 29 Mar 2023 17:51:25 +0200 Subject: [PATCH] Added old cpu temp reading as fallback --- app/HardwareMonitor.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/HardwareMonitor.cs b/app/HardwareMonitor.cs index 7c6d4600..8576ce8e 100644 --- a/app/HardwareMonitor.cs +++ b/app/HardwareMonitor.cs @@ -41,10 +41,12 @@ public static class HardwareMonitor try { cpuTemp = Program.wmi.DeviceGet(ASUSWmi.Temp_CPU); - /* - var ct = new PerformanceCounter("Thermal Zone Information", "Temperature", @"\_TZ.THRM", true); - cpuTemp = ct.NextValue() - 273; - ct.Dispose();*/ + if (cpuTemp < 0) + { + var ct = new PerformanceCounter("Thermal Zone Information", "Temperature", @"\_TZ.THRM", true); + cpuTemp = ct.NextValue() - 273; + ct.Dispose(); + } } catch { Logger.WriteLine("Failed reading CPU temp");