fix sensor name overwrites occasionally

pull/19/head
sleevezipper 4 years ago
parent ba427a2065
commit 7dde2a19ea

@ -12,7 +12,7 @@ namespace hass_workstation_service.Domain.Sensors
[SupportedOSPlatform("windows")]
public class MemoryUsageSensor : WMIQuerySensor
{
public MemoryUsageSensor(MqttPublisher publisher, int? updateInterval = null, string name = "MemoryUsage", Guid id = default) : base(publisher, "SELECT FreePhysicalMemory,TotalVisibleMemorySize FROM Win32_OperatingSystem", updateInterval ?? 10, name, id)
public MemoryUsageSensor(MqttPublisher publisher, int? updateInterval = null, string name = "MemoryUsage", Guid id = default) : base(publisher, "SELECT FreePhysicalMemory,TotalVisibleMemorySize FROM Win32_OperatingSystem", updateInterval ?? 10, name ?? "MemoryUsage", id)
{
}
public override string GetState()

@ -9,7 +9,7 @@ namespace hass_workstation_service.Domain.Sensors
{
public class WebcamActiveSensor : AbstractSensor
{
public WebcamActiveSensor(MqttPublisher publisher, int? updateInterval = null, string name = "WebcamActive", Guid id = default) : base(publisher, name, updateInterval ?? 10, id)
public WebcamActiveSensor(MqttPublisher publisher, int? updateInterval = null, string name = "WebcamActive", Guid id = default) : base(publisher, name ?? "WebcamActive", updateInterval ?? 10, id)
{
}
public override string GetState()

Loading…
Cancel
Save