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.Timers;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using PepperDash.Core;
using PepperDash.Essentials.Core.DeviceInfo;
using System.Timers;
namespace PepperDash.Essentials.AppServer.Messengers
{
@@ -67,13 +67,20 @@ namespace PepperDash.Essentials.AppServer.Messengers
debounceTimer.Start();
};
AddAction("/fullStatus", (id, context) => PostStatusMessage(new DeviceInfoStateMessage
{
DeviceInfo = _deviceInfoProvider.DeviceInfo
}));
AddAction("/fullStatus", (id, context) => SendFullStatus(id));
AddAction("/deviceInfo", (id, content) => SendFullStatus(id));
AddAction("/update", (id, context) => _deviceInfoProvider.UpdateDeviceInfo());
}
private void SendFullStatus(string id = null)
{
PostStatusMessage(new DeviceInfoStateMessage
{
DeviceInfo = _deviceInfoProvider.DeviceInfo
}, id);
}
}
/// <summary>