fix: add null value handling and make some values nullable

This commit is contained in:
Andrew Welker
2024-05-28 13:50:53 -05:00
parent b590bfe97b
commit fa88e1b744

View File

@@ -20,14 +20,14 @@ namespace PepperDash.Core
/// <summary> /// <summary>
/// The key of the device that contains the control port /// The key of the device that contains the control port
/// </summary> /// </summary>
[JsonProperty("controlPortDevKey")] [JsonProperty("controlPortDevKey", NullValueHandling = NullValueHandling.Ignore)]
public string ControlPortDevKey { get; set; } public string ControlPortDevKey { get; set; }
/// <summary> /// <summary>
/// The number of the control port on the device specified by ControlPortDevKey /// The number of the control port on the device specified by ControlPortDevKey
/// </summary> /// </summary>
[JsonProperty("controlPortNumber", NullValueHandling = NullValueHandling.Ignore)] // In case "null" is present in config on this value [JsonProperty("controlPortNumber", NullValueHandling = NullValueHandling.Ignore)] // In case "null" is present in config on this value
public uint ControlPortNumber { get; set; } public uint? ControlPortNumber { get; set; }
/// <summary> /// <summary>
/// The name of the control port on the device specified by ControlPortDevKey /// The name of the control port on the device specified by ControlPortDevKey
@@ -38,19 +38,19 @@ namespace PepperDash.Core
/// <summary> /// <summary>
/// Properties for ethernet based communications /// Properties for ethernet based communications
/// </summary> /// </summary>
[JsonProperty("tcpSshProperties")] [JsonProperty("tcpSshProperties", NullValueHandling = NullValueHandling.Ignore)]
public TcpSshPropertiesConfig TcpSshProperties { get; set; } public TcpSshPropertiesConfig TcpSshProperties { get; set; }
/// <summary> /// <summary>
/// The filename and path for the IR file /// The filename and path for the IR file
/// </summary> /// </summary>
[JsonProperty("irFile")] [JsonProperty("irFile", NullValueHandling = NullValueHandling.Ignore)]
public string IrFile { get; set; } public string IrFile { get; set; }
/// <summary> /// <summary>
/// The IpId of a Crestron device /// The IpId of a Crestron device
/// </summary> /// </summary>
[JsonProperty("ipId")] [JsonProperty("ipId", NullValueHandling = NullValueHandling.Ignore)]
public string IpId { get; set; } public string IpId { get; set; }
/// <summary> /// <summary>
@@ -62,33 +62,32 @@ namespace PepperDash.Core
/// <summary> /// <summary>
/// Char indicating end of line /// Char indicating end of line
/// </summary> /// </summary>
[JsonProperty("endOfLineChar")] [JsonProperty("endOfLineChar", NullValueHandling = NullValueHandling.Ignore)]
public char EndOfLineChar { get; set; } public char EndOfLineChar { get; set; }
/// <summary> /// <summary>
/// Defaults to Environment.NewLine; /// Defaults to Environment.NewLine;
/// </summary> /// </summary>
[JsonProperty("endOfLineString")] [JsonProperty("endOfLineString", NullValueHandling = NullValueHandling.Ignore)]
public string EndOfLineString { get; set; } public string EndOfLineString { get; set; }
/// <summary> /// <summary>
/// Indicates /// Indicates
/// </summary> /// </summary>
[JsonProperty("deviceReadyResponsePattern")] [JsonProperty("deviceReadyResponsePattern", NullValueHandling = NullValueHandling.Ignore)]
public string DeviceReadyResponsePattern { get; set; } public string DeviceReadyResponsePattern { get; set; }
/// <summary> /// <summary>
/// Used when communcating to programs running in VC-4 /// Used when communcating to programs running in VC-4
/// </summary> /// </summary>
[JsonProperty("roomId")] [JsonProperty("roomId", NullValueHandling = NullValueHandling.Ignore)]
public string RoomId { get; set; } public string RoomId { get; set; }
/// <summary> /// <summary>
/// Constructor /// Constructor
/// </summary> /// </summary>
public ControlPropertiesConfig() public ControlPropertiesConfig()
{ {
EndOfLineString = CrestronEnvironment.NewLine;
} }
} }
} }