feat: unique status requests for messengers

UI Applications can now request status for specific feature sets instead of full status for a device. This will hopefully cut down on the traffic and messages required to get the data for the UI.
This commit is contained in:
Andrew Welker
2025-09-23 10:55:16 -05:00
parent cae1bbd6e6
commit 9c9eaea928
45 changed files with 619 additions and 425 deletions

View File

@@ -1,8 +1,8 @@
using Newtonsoft.Json;
using System;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Core.Logging;
using PepperDash.Essentials.Core;
using System;
namespace PepperDash.Essentials.AppServer.Messengers
@@ -36,7 +36,9 @@ namespace PepperDash.Essentials.AppServer.Messengers
protected override void RegisterActions()
{
AddAction("/fullStatus", (id, content) => SendRoutingFullMessageObject());
AddAction("/fullStatus", (id, content) => SendRoutingFullMessageObject(id));
AddAction("/routingStatus", (id, content) => SendRoutingFullMessageObject(id));
AddAction("/source", (id, content) =>
{
@@ -62,7 +64,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
/// <summary>
/// Helper method to update full status of the routing device
/// </summary>
private void SendRoutingFullMessageObject()
private void SendRoutingFullMessageObject(string id = null)
{
if (RoutingDevice is IRoutingSink sinkDevice)
{
@@ -84,10 +86,10 @@ namespace PepperDash.Essentials.AppServer.Messengers
/// </summary>
public class RoutingStateMessage : DeviceStateMessageBase
{
[JsonProperty("selectedSourceKey")]
/// <summary>
/// Gets or sets the SelectedSourceKey
/// </summary>
[JsonProperty("selectedSourceKey")]
public string SelectedSourceKey { get; set; }
}
}