* Fix: https://github.com/LibreHardwareMonitor/LibreHardwareMonitor/issues/153
Add temperature Sensor Ranges

Fix: https://github.com/LibreHardwareMonitor/LibreHardwareMonitor/issues/152
New exit function

Fix: https://github.com/LibreHardwareMonitor/LibreHardwareMonitor/pull/138
No drive info exception when LHM is in a Virtual Machine

* Bugfix Update
This commit is contained in:
sebastian-dev
2019-10-20 10:27:37 +02:00
committed by Phyxion
parent af9fb0231d
commit fa2ef007af
4 changed files with 25 additions and 8 deletions
@@ -68,6 +68,9 @@ namespace LibreHardwareMonitor.Hardware.Storage
public static AbstractStorage CreateInstance(string deviceId, uint driveNumber, ulong diskSize, int scsiPort, ISettings settings)
{
StorageInfo info = WindowsStorage.GetStorageInfo(deviceId, driveNumber);
if (info == null)
return null;
info.DiskSize = diskSize;
info.DeviceId = deviceId;
info.Scsi = $@"\\.\SCSI{scsiPort}:";
@@ -72,8 +72,8 @@ namespace LibreHardwareMonitor.Hardware.Storage
private void AddSensor(string name, int index, bool defaultHidden, SensorType sensorType, GetSensorValue getValue)
{
var sensor = new NVMeSensor(name, index, defaultHidden, sensorType, this, _settings, getValue);
ActivateSensor(sensor);
sensor.Value = 0;
ActivateSensor(sensor);
_sensors.Add(sensor);
}
@@ -175,7 +175,13 @@ namespace LibreHardwareMonitor.Hardware.Storage
public void Update(NVMeHealthInfo health)
{
Value = _getValue(health);
float v = _getValue(health);
if (SensorType == SensorType.Temperature)
{
if (v < -1000 || v > 1000)
return;
}
Value = v;
}
}
}