mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-04 07:14:58 +00:00
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.
36 lines
1.0 KiB
C#
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);
|
|
}
|
|
}
|
|
}
|