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

@@ -55,7 +55,9 @@ namespace PepperDash.Essentials.AppServer.Messengers
{
base.RegisterActions();
AddAction("/fullStatus", (id, content) => SendCameraFullMessageObject());
AddAction("/fullStatus", (id, content) => SendCameraFullMessageObject(id));
AddAction("/cameraStatus", (id, content) => SendCameraFullMessageObject(id));
if (Camera is IHasCameraPtzControl ptzCamera)
@@ -173,7 +175,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
/// <summary>
/// Helper method to update the full status of the camera
/// </summary>
private void SendCameraFullMessageObject()
private void SendCameraFullMessageObject(string id = null)
{
var presetList = new List<CameraPreset>();
@@ -188,7 +190,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
cameraMode = GetCameraMode(),
hasPresets = Camera is IHasCameraPresets,
presets = presetList
})
}), id
);
}