mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-07-02 10:38:16 +00:00
feat: Remove IRoutingSinkWithFeedbackMessenger class and its associated actions
This commit is contained in:
parent
f64b595fd7
commit
ec7db1b510
1 changed files with 0 additions and 71 deletions
|
|
@ -1,71 +0,0 @@
|
|||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Core.Logging;
|
||||
using PepperDash.Essentials.AppServer;
|
||||
using PepperDash.Essentials.AppServer.Messengers;
|
||||
using PepperDash.Essentials.Core;
|
||||
using System.Linq;
|
||||
using DisplayBase = PepperDash.Essentials.Devices.Common.Displays.DisplayBase;
|
||||
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a DisplayBaseMessenger
|
||||
/// </summary>
|
||||
public class IRoutingSinkWithFeedbackMessenger : MessengerBase
|
||||
{
|
||||
private readonly IRoutingSinkWithFeedback display;
|
||||
|
||||
/// <summary>
|
||||
/// Create an instance of the <see cref="IRoutingSinkWithFeedbackMessenger"/> class.
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="messagePath"></param>
|
||||
/// <param name="device"></param>
|
||||
public IRoutingSinkWithFeedbackMessenger(string key, string messagePath, IRoutingSinkWithFeedback device) : base(key, messagePath, device)
|
||||
{
|
||||
display = device;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void RegisterActions()
|
||||
{
|
||||
base.RegisterActions();
|
||||
|
||||
/*AddAction("/powerOn", (id, content) => display.PowerOn());
|
||||
AddAction("/powerOff", (id, content) => display.PowerOff());
|
||||
AddAction("/powerToggle", (id, content) => display.PowerToggle());*/
|
||||
|
||||
AddAction("/inputSelect", (id, content) =>
|
||||
{
|
||||
var s = content.ToObject<MobileControlSimpleContent<string>>();
|
||||
|
||||
var inputPort = display.InputPorts.FirstOrDefault(i => i.Key == s.Value);
|
||||
|
||||
if (inputPort == null)
|
||||
{
|
||||
this.LogWarning("No input named {inputName} found for {deviceKey}", s, display.Key);
|
||||
return;
|
||||
}
|
||||
|
||||
display.ExecuteSwitch(inputPort.Selector);
|
||||
});
|
||||
|
||||
AddAction("/inputs", (id, content) =>
|
||||
{
|
||||
var inputsList = display.InputPorts.Select(p => p.Key).ToList();
|
||||
|
||||
var messageObject = new MobileControlMessage
|
||||
{
|
||||
Type = MessagePath + "/inputs",
|
||||
Content = JToken.FromObject(new
|
||||
{
|
||||
inputKeys = inputsList,
|
||||
})
|
||||
};
|
||||
|
||||
AppServerController.SendMessageObject(messageObject);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue