Added old cpu temp reading as fallback

This commit is contained in:
seerge
2023-03-29 17:51:25 +02:00
parent af2509fc17
commit 0cbc48d526

View File

@@ -41,10 +41,12 @@ public static class HardwareMonitor
try try
{ {
cpuTemp = Program.wmi.DeviceGet(ASUSWmi.Temp_CPU); cpuTemp = Program.wmi.DeviceGet(ASUSWmi.Temp_CPU);
/* if (cpuTemp < 0)
var ct = new PerformanceCounter("Thermal Zone Information", "Temperature", @"\_TZ.THRM", true); {
cpuTemp = ct.NextValue() - 273; var ct = new PerformanceCounter("Thermal Zone Information", "Temperature", @"\_TZ.THRM", true);
ct.Dispose();*/ cpuTemp = ct.NextValue() - 273;
ct.Dispose();
}
} catch } catch
{ {
Logger.WriteLine("Failed reading CPU temp"); Logger.WriteLine("Failed reading CPU temp");