fix: handle null properties in DeviceMessageBase and DeviceStateMessageBase

This commit is contained in:
Neil Dorin 2026-06-10 13:34:05 -06:00
parent 75587c361f
commit ec84a2bfbb
2 changed files with 6 additions and 5 deletions

View file

@ -10,7 +10,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
/// <summary>
/// The device key
/// </summary>
[JsonProperty("key")]
[JsonProperty("key", NullValueHandling = NullValueHandling.Ignore)]
/// <summary>
/// Gets or sets the Key
/// </summary>
@ -19,19 +19,19 @@ namespace PepperDash.Essentials.AppServer.Messengers
/// <summary>
/// The device name
/// </summary>
[JsonProperty("name")]
[JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
public string Name { get; set; }
/// <summary>
/// The type of the message class
/// </summary>
[JsonProperty("messageType")]
[JsonProperty("messageType", NullValueHandling = NullValueHandling.Ignore)]
public string MessageType => GetType().Name;
/// <summary>
/// Gets or sets the MessageBasePath
/// </summary>
[JsonProperty("messageBasePath")]
[JsonProperty("messageBasePath", NullValueHandling = NullValueHandling.Ignore)]
public string MessageBasePath { get; set; }
}

View file

@ -12,7 +12,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
/// <summary>
/// The interfaces implmented by the device sending the messsage
/// </summary>
[JsonProperty("interfaces")]
[JsonProperty("interfaces", NullValueHandling = NullValueHandling.Ignore)]
[Obsolete("Interfaces is no longer supported and will be removed in a future release. Interfaces for all devices are now retrieved via the /joinroom endpoint in the MobileControlWebsocketServer")]
public List<string> Interfaces { get; private set; }
/// <summary>