mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Restored fallback CPU temp reading method
This commit is contained in:
@@ -209,7 +209,19 @@ public static class HardwareControl
|
|||||||
lastUpdate = last;
|
lastUpdate = last;
|
||||||
|
|
||||||
cpuTemp = Program.acpi.DeviceGet(AsusACPI.Temp_CPU);
|
cpuTemp = Program.acpi.DeviceGet(AsusACPI.Temp_CPU);
|
||||||
//Debug.WriteLine(cpuTemp);
|
|
||||||
|
if (cpuTemp < 0) try
|
||||||
|
{
|
||||||
|
using (var ct = new PerformanceCounter("Thermal Zone Information", "Temperature", @"\_TZ.THRM", true))
|
||||||
|
{
|
||||||
|
cpuTemp = ct.NextValue() - 273;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Debug.WriteLine("Failed reading CPU temp :" + ex.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return cpuTemp;
|
return cpuTemp;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user