|
1 | | -#if !NORING |
2 | | -using LibreHardwareMonitor.Hardware; |
3 | | -#endif |
4 | 1 | using Microsoft.Win32; |
5 | 2 | using Newtonsoft.Json; |
6 | 3 | using Newtonsoft.Json.Linq; |
@@ -34,7 +31,6 @@ public static async Task MakeHardwareData() |
34 | 31 |
|
35 | 32 | List<Task> hardwareTaskList = new() |
36 | 33 | { |
37 | | - DoTask(region, "GetTemps", GetTemps), |
38 | 34 | DoTask(region, "GetHardwareWmiData", GetHardwareWmiData), |
39 | 35 | DoTask(region, "GetMonitorInfo", GetMonitorInfo), |
40 | 36 | DoTask(region, "GetSMBiosMemoryInfo", GetSMBiosMemoryInfo), |
@@ -1313,61 +1309,6 @@ private static string GetAttributeName(byte id) |
1313 | 1309 | ; |
1314 | 1310 | } |
1315 | 1311 |
|
1316 | | - // TEMPERATURES |
1317 | | - private static async Task GetTemps() |
1318 | | - { |
1319 | | - #if NORING |
1320 | | - await LogEventAsync($"Specify No Ring 0 version running. Temperatures will not be collected.", Region.Hardware, EventType.WARNING); |
1321 | | - #else |
1322 | | - //Any temp sensor reading below 24 will be filtered out |
1323 | | - //These sensors are either not reading in celsius, are in error, or we cannot interpret them properly here |
1324 | | - var Temps = new List<TempMeasurement>(); |
1325 | | - var computer = new Computer |
1326 | | - { |
1327 | | - IsCpuEnabled = true, |
1328 | | - IsGpuEnabled = true, |
1329 | | - IsMotherboardEnabled = true |
1330 | | - }; |
1331 | | - |
1332 | | - try |
1333 | | - { |
1334 | | - computer.Open(); |
1335 | | - computer.Accept(new SensorUpdateVisitor()); |
1336 | | - |
1337 | | - foreach (var hardware in computer.Hardware) |
1338 | | - { |
1339 | | - Temps.AddRange( |
1340 | | - from subhardware in hardware.SubHardware |
1341 | | - from sensor in subhardware.Sensors |
1342 | | - where sensor.SensorType.Equals(SensorType.Temperature) && sensor.Value > 24 || sensor.Name.ToLower().Contains("tjmax") |
1343 | | - select new TempMeasurement |
1344 | | - { Hardware = hardware.Name, SensorName = sensor.Name, SensorValue = sensor.Value.Value } |
1345 | | - ); |
1346 | | - |
1347 | | - Temps.AddRange( |
1348 | | - from sensor in hardware.Sensors |
1349 | | - where sensor.SensorType.Equals(SensorType.Temperature) && sensor.Value > 24 || sensor.Name.ToLower().Contains("tjmax") |
1350 | | - select new TempMeasurement |
1351 | | - { Hardware = hardware.Name, SensorName = sensor.Name, SensorValue = sensor.Value.Value } |
1352 | | - ); |
1353 | | - } |
1354 | | - } |
1355 | | - catch (OverflowException) |
1356 | | - { |
1357 | | - await LogEventAsync("Absolute value overflow occurred when fetching temperature data", Region.Hardware, EventType.ERROR); |
1358 | | - } |
1359 | | - catch (Exception ex) |
1360 | | - { |
1361 | | - await LogEventAsync($"Exception during temperature measurement: " + ex, Region.Hardware, EventType.ERROR); |
1362 | | - } |
1363 | | - finally |
1364 | | - { |
1365 | | - computer.Close(); |
1366 | | - } |
1367 | | - Temperatures = Temps; |
1368 | | -#endif |
1369 | | - } |
1370 | | - |
1371 | 1312 | // BATTERIES |
1372 | 1313 | private static async Task GetBatteryData() |
1373 | 1314 | { |
|
0 commit comments