feat: change to use Debug.LogMessage everywhere

This commit is contained in:
Andrew Welker
2024-03-21 13:44:08 -05:00
parent 4d0e3b1943
commit ee4ccb0d1a
110 changed files with 1033 additions and 988 deletions

View File

@@ -5,6 +5,7 @@ using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.CrestronIO;
using PepperDash.Essentials.Core.Shades;
using Serilog.Events;
namespace PepperDash.Essentials.Devices.Common.Shades
{
@@ -47,21 +48,21 @@ namespace PepperDash.Essentials.Devices.Common.Shades
public override void Open()
{
Debug.Console(1, this, "Opening Shade: '{0}'", this.Name);
Debug.LogMessage(LogEventLevel.Debug, this, "Opening Shade: '{0}'", this.Name);
PulseOutput(OpenRelay, RelayPulseTime);
}
public override void Stop()
{
Debug.Console(1, this, "Stopping Shade: '{0}'", this.Name);
Debug.LogMessage(LogEventLevel.Debug, this, "Stopping Shade: '{0}'", this.Name);
PulseOutput(StopOrPresetRelay, RelayPulseTime);
}
public override void Close()
{
Debug.Console(1, this, "Closing Shade: '{0}'", this.Name);
Debug.LogMessage(LogEventLevel.Debug, this, "Closing Shade: '{0}'", this.Name);
PulseOutput(CloseRelay, RelayPulseTime);
}
@@ -87,7 +88,7 @@ namespace PepperDash.Essentials.Devices.Common.Shades
}
else
{
Debug.Console(1, this, "Error: Unable to get relay on port '{0}' from device with key '{1}'", relayConfig.PortNumber, relayConfig.PortDeviceKey);
Debug.LogMessage(LogEventLevel.Debug, this, "Error: Unable to get relay on port '{0}' from device with key '{1}'", relayConfig.PortNumber, relayConfig.PortDeviceKey);
return null;
}
}
@@ -117,7 +118,7 @@ namespace PepperDash.Essentials.Devices.Common.Shades
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new Generic Comm Device");
Debug.LogMessage(LogEventLevel.Debug, "Factory Attempting to create new Generic Comm Device");
var props = Newtonsoft.Json.JsonConvert.DeserializeObject<RelayControlledShadeConfigProperties>(dc.Properties.ToString());
return new RelayControlledShade(dc.Key, dc.Name, props);

View File

@@ -3,6 +3,7 @@ using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Shades;
using Serilog.Events;
namespace PepperDash.Essentials.Devices.Common.Shades
{
@@ -63,7 +64,7 @@ namespace PepperDash.Essentials.Devices.Common.Shades
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new ShadeController Device");
Debug.LogMessage(LogEventLevel.Debug, "Factory Attempting to create new ShadeController Device");
var props = Newtonsoft.Json.JsonConvert.DeserializeObject<ShadeControllerConfigProperties>(dc.Properties.ToString());
return new ShadeController(dc.Key, dc.Name, props);