diff --git a/LibreHardwareMonitor/UI/SensorNode.cs b/LibreHardwareMonitor/UI/SensorNode.cs index 3cd878e..22e723e 100644 --- a/LibreHardwareMonitor/UI/SensorNode.cs +++ b/LibreHardwareMonitor/UI/SensorNode.cs @@ -243,7 +243,7 @@ public class SensorNode : Node } case SensorType.TimeSpan: { - return value.HasValue ? string.Format(Format, TimeSpan.FromSeconds(value.Value)) : "-"; + return string.Format(Format, TimeSpan.FromSeconds(value.Value)); } default: { diff --git a/LibreHardwareMonitor/Utilities/HttpServer.cs b/LibreHardwareMonitor/Utilities/HttpServer.cs index c8f5d04..8f3db35 100644 --- a/LibreHardwareMonitor/Utilities/HttpServer.cs +++ b/LibreHardwareMonitor/Utilities/HttpServer.cs @@ -627,9 +627,17 @@ public class HttpServer case SensorNode sensorNode: jsonNode["SensorId"] = sensorNode.Sensor.Identifier.ToString(); jsonNode["Type"] = sensorNode.Sensor.SensorType.ToString(); + + // Formatted values, e.g. Throughput will be measured in KB/s or MB/s depending on the value jsonNode["Min"] = sensorNode.Min; jsonNode["Value"] = sensorNode.Value; jsonNode["Max"] = sensorNode.Max; + + // Unformatted values for external systems to have consistent readings, e.g. Throughput will always be measured in B/s + jsonNode["RawMin"] = string.Format(sensorNode.Format, sensorNode.Sensor.Min); + jsonNode["RawValue"] = string.Format(sensorNode.Format, sensorNode.Sensor.Value); + jsonNode["RawMax"] = string.Format(sensorNode.Format, sensorNode.Sensor.Max); + jsonNode["ImageURL"] = "images/transparent.png"; break; case HardwareNode hardwareNode: