mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-27 19:34:51 +00:00
When Essentials moved to using `System.Reflection` instead of the Crestron classes, there were some leftover `GetType` calls that were no longer necessary. These extra calls were preventing things from getting the correct type. Join Map printing was also fixed to print out in an actual readable fashion.
66 lines
1.8 KiB
C#
66 lines
1.8 KiB
C#
using PepperDash.Core;
|
|
using Serilog.Events;
|
|
|
|
//using PepperDash.Essentials.Devices.Common.Cameras;
|
|
|
|
namespace PepperDash.Essentials.Core.Bridges
|
|
{
|
|
/// <summary>
|
|
/// Helper methods for bridges
|
|
/// </summary>
|
|
public static class BridgeHelper
|
|
{
|
|
public static void PrintJoinMap(string command)
|
|
{
|
|
var targets = command.Split(' ');
|
|
|
|
var bridgeKey = targets[0].Trim();
|
|
|
|
if (!(DeviceManager.GetDeviceForKey(bridgeKey) is EiscApiAdvanced bridge))
|
|
{
|
|
Debug.LogMessage(LogEventLevel.Information, "Unable to find advanced bridge with key: '{0}'", bridgeKey);
|
|
return;
|
|
}
|
|
|
|
if (targets.Length > 1)
|
|
{
|
|
var deviceKey = targets[1].Trim();
|
|
|
|
if (string.IsNullOrEmpty(deviceKey)) return;
|
|
bridge.PrintJoinMapForDevice(deviceKey);
|
|
}
|
|
else
|
|
{
|
|
bridge.PrintJoinMaps();
|
|
}
|
|
}
|
|
public static void JoinmapMarkdown(string command)
|
|
{
|
|
var targets = command.Split(' ');
|
|
|
|
var bridgeKey = targets[0].Trim();
|
|
|
|
var bridge = DeviceManager.GetDeviceForKey(bridgeKey) as EiscApiAdvanced;
|
|
|
|
if (bridge == null)
|
|
{
|
|
Debug.LogMessage(LogEventLevel.Information, "Unable to find advanced bridge with key: '{0}'", bridgeKey);
|
|
return;
|
|
}
|
|
|
|
if (targets.Length > 1)
|
|
{
|
|
var deviceKey = targets[1].Trim();
|
|
|
|
if (string.IsNullOrEmpty(deviceKey)) return;
|
|
bridge.MarkdownJoinMapForDevice(deviceKey, bridgeKey);
|
|
}
|
|
else
|
|
{
|
|
bridge.MarkdownForBridge(bridgeKey);
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
} |