-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: joins in join maps get added correctly to a bridge
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.
- Loading branch information
Andrew Welker
committed
Oct 30, 2024
1 parent
1a11e90
commit 332faaa
Showing
6 changed files
with
137 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
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); | ||
|
||
} | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.