diff --git a/LibreHardwareMonitor/Resources/humidity.png b/LibreHardwareMonitor/Resources/humidity.png new file mode 100644 index 0000000..b6f9e90 Binary files /dev/null and b/LibreHardwareMonitor/Resources/humidity.png differ diff --git a/LibreHardwareMonitor/UI/PlotPanel.cs b/LibreHardwareMonitor/UI/PlotPanel.cs index a509df4..c435737 100644 --- a/LibreHardwareMonitor/UI/PlotPanel.cs +++ b/LibreHardwareMonitor/UI/PlotPanel.cs @@ -200,7 +200,8 @@ public class PlotPanel : UserControl { SensorType.Data, "GB" }, { SensorType.Frequency, "Hz" }, { SensorType.Energy, "mWh" }, - { SensorType.Noise, "dBA" } + { SensorType.Noise, "dBA" }, + { SensorType.Humidity, "%" } }; foreach (SensorType type in Enum.GetValues(typeof(SensorType))) @@ -415,4 +416,4 @@ public class PlotPanel : UserControl foreach (LinearAxis axis in _axes.Values) axis.Zoom(double.NaN, double.NaN); } -} \ No newline at end of file +} diff --git a/LibreHardwareMonitor/UI/SensorGadget.cs b/LibreHardwareMonitor/UI/SensorGadget.cs index 7c3b055..84e93c5 100644 --- a/LibreHardwareMonitor/UI/SensorGadget.cs +++ b/LibreHardwareMonitor/UI/SensorGadget.cs @@ -598,7 +598,8 @@ public class SensorGadget : Gadget if ((sensor.SensorType != SensorType.Load && sensor.SensorType != SensorType.Control && - sensor.SensorType != SensorType.Level) || !sensor.Value.HasValue) + sensor.SensorType != SensorType.Level && + sensor.SensorType != SensorType.Humidity) || !sensor.Value.HasValue) { string formatted; @@ -751,4 +752,4 @@ public class SensorGadget : Gadget return x.Identifier.CompareTo(y.Identifier); } } -} \ No newline at end of file +} diff --git a/LibreHardwareMonitor/UI/SensorNode.cs b/LibreHardwareMonitor/UI/SensorNode.cs index d1335fd..505977a 100644 --- a/LibreHardwareMonitor/UI/SensorNode.cs +++ b/LibreHardwareMonitor/UI/SensorNode.cs @@ -82,6 +82,9 @@ public class SensorNode : Node case SensorType.Noise: Format = "{0:F0} dBA"; break; + case SensorType.Humidity: + Format = "{0:F0} %"; + break; } bool hidden = settings.GetValue(new Identifier(sensor.Identifier, "hidden").ToString(), sensor.IsDefaultHidden); @@ -276,4 +279,4 @@ public class SensorNode : Node { return Sensor.GetHashCode(); } -} \ No newline at end of file +} diff --git a/LibreHardwareMonitor/UI/SensorNotifyIcon.cs b/LibreHardwareMonitor/UI/SensorNotifyIcon.cs index d622a76..5987efb 100644 --- a/LibreHardwareMonitor/UI/SensorNotifyIcon.cs +++ b/LibreHardwareMonitor/UI/SensorNotifyIcon.cs @@ -183,6 +183,7 @@ public class SensorNotifyIcon : IDisposable case SensorType.Load: case SensorType.Energy: case SensorType.Noise: + case SensorType.Humidity: return $"{Sensor.Value:F0}"; default: return "-"; @@ -259,6 +260,7 @@ public class SensorNotifyIcon : IDisposable case SensorType.Factor: format = "\n{0}: {1:F3} GB"; break; case SensorType.Energy: format = "\n{0}: {0:F0} mWh"; break; case SensorType.Noise: format = "\n{0}: {0:F0} dBA"; break; + case SensorType.Humidity: format = "\n{0}: {0:F0} %"; break; } string formattedValue = string.Format(format, Sensor.Name, Sensor.Value); @@ -277,4 +279,4 @@ public class SensorNotifyIcon : IDisposable _notifyIcon.Text = text; _notifyIcon.Visible = true; } -} \ No newline at end of file +} diff --git a/LibreHardwareMonitor/UI/TypeNode.cs b/LibreHardwareMonitor/UI/TypeNode.cs index 6162ce7..96d3ea7 100644 --- a/LibreHardwareMonitor/UI/TypeNode.cs +++ b/LibreHardwareMonitor/UI/TypeNode.cs @@ -95,6 +95,10 @@ public sealed class TypeNode : Node, IExpandPersistNode Image = Utilities.EmbeddedResources.GetImage("loudspeaker.png"); Text = "Noise Levels"; break; + case SensorType.Humidity: + Image = Utilities.EmbeddedResources.GetImage("humidity.png"); + Text = "Humidity Levels"; + break; } NodeAdded += TypeNode_NodeAdded; @@ -138,4 +142,4 @@ public sealed class TypeNode : Node, IExpandPersistNode _settings.SetValue(_expandedIdentifier, _expanded); } } -} \ No newline at end of file +} diff --git a/LibreHardwareMonitor/Utilities/HttpServer.cs b/LibreHardwareMonitor/Utilities/HttpServer.cs index 9379ebe..1d7d203 100644 --- a/LibreHardwareMonitor/Utilities/HttpServer.cs +++ b/LibreHardwareMonitor/Utilities/HttpServer.cs @@ -679,6 +679,8 @@ public class HttpServer return "loudspeaker.png"; case SensorType.Throughput: return "throughput.png"; + case SensorType.Humidity: + return "flow.png"; default: return "power.png"; } @@ -703,4 +705,4 @@ public class HttpServer StopHttpListener(); _listener.Abort(); } -} \ No newline at end of file +} diff --git a/LibreHardwareMonitorLib/Hardware/ISensor.cs b/LibreHardwareMonitorLib/Hardware/ISensor.cs index 33b7cd8..802c5db 100644 --- a/LibreHardwareMonitorLib/Hardware/ISensor.cs +++ b/LibreHardwareMonitorLib/Hardware/ISensor.cs @@ -31,7 +31,8 @@ public enum SensorType Throughput, // B/s TimeSpan, // Seconds Energy, // milliwatt-hour (mWh) - Noise // dBA + Noise, // dBA + Humidity // % } ///