This commit is contained in:
seerge
2023-03-13 23:21:06 +01:00
parent e9ec8f0e8f
commit 254be71e88

View File

@@ -19,8 +19,7 @@ public static class HardwareMonitor
var ct = new PerformanceCounter("Thermal Zone Information", "Temperature", @"\_TZ.THRM", true); var ct = new PerformanceCounter("Thermal Zone Information", "Temperature", @"\_TZ.THRM", true);
cpuTemp = ct.NextValue() - 273; cpuTemp = ct.NextValue() - 273;
ct.Dispose(); ct.Dispose();
} } catch
catch
{ {
Logger.WriteLine("Failed reading CPU temp"); Logger.WriteLine("Failed reading CPU temp");
} }
@@ -31,8 +30,7 @@ public static class HardwareMonitor
batteryDischarge = cb.NextValue() / 1000; batteryDischarge = cb.NextValue() / 1000;
cb.Dispose(); cb.Dispose();
} } catch
catch
{ {
Logger.WriteLine("Failed reading Battery discharge"); Logger.WriteLine("Failed reading Battery discharge");
} }