Files
Essentials/src/PepperDash.Essentials.MobileControl.Messengers/Messengers/GenericMessenger.cs
Andrew Welker 9c9eaea928 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.
2025-09-23 10:55:16 -05:00

36 lines
1.0 KiB
C#

using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.AppServer.Messengers
{
/// <summary>
/// Represents a GenericMessenger
/// </summary>
public class GenericMessenger : MessengerBase
{
/// <summary>
/// Initializes a new instance of the <see cref="GenericMessenger"/> class.
/// </summary>
/// <param name="key">The key.</param>
/// <param name="device">The device.</param>
/// <param name="messagePath">The message path.</param>
public GenericMessenger(string key, EssentialsDevice device, string messagePath) : base(key, messagePath, device)
{
}
/// <inheritdoc />
protected override void RegisterActions()
{
base.RegisterActions();
AddAction("/fullStatus", (id, content) => SendFullStatus(id));
}
private void SendFullStatus(string id = null)
{
var state = new DeviceStateMessageBase();
PostStatusMessage(state, id);
}
}
}