From 2cc37a4e40550704a5dabe0142247adbe8628373 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 23 Dec 2025 11:06:52 -0600 Subject: [PATCH] fix: ExecuteJoinAction now uses the correct Sig collections --- .../Bridges/BridgeBase.cs | 38 ++++++++++++------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/src/PepperDash.Essentials.Core/Bridges/BridgeBase.cs b/src/PepperDash.Essentials.Core/Bridges/BridgeBase.cs index 1b8e826e..070f1743 100644 --- a/src/PepperDash.Essentials.Core/Bridges/BridgeBase.cs +++ b/src/PepperDash.Essentials.Core/Bridges/BridgeBase.cs @@ -273,17 +273,18 @@ namespace PepperDash.Essentials.Core.Bridges } case "analog": { - if (Eisc.BooleanOutput[join].UserObject is Action userObject) + if (Eisc.UShortOutput[join].UserObject is Action userObject) { this.LogVerbose("Executing Analog Action"); userObject(Convert.ToUInt16(state)); } else - this.LogVerbose("User Object is null. Nothing to Execute"); break; + this.LogVerbose("User Object is null. Nothing to Execute"); + break; } case "serial": { - if (Eisc.BooleanOutput[join].UserObject is Action userObject) + if (Eisc.StringOutput[join].UserObject is Action userObject) { this.LogVerbose("Executing Serial Action"); userObject(Convert.ToString(state)); @@ -316,18 +317,27 @@ namespace PepperDash.Essentials.Core.Bridges { try { - this.LogVerbose("EiscApiAdvanced change: {0} {1}={2}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue); - var uo = args.Sig.UserObject; + this.LogVerbose("EiscApiAdvanced change: {type} {number}={value}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue); + var userObject = args.Sig.UserObject; - if (uo == null) return; + if (userObject == null) return; - this.LogDebug("Executing Action: {0}", uo.ToString()); - if (uo is Action) - (uo as Action)(args.Sig.BoolValue); - else if (uo is Action) - (uo as Action)(args.Sig.UShortValue); - else if (uo is Action) - (uo as Action)(args.Sig.StringValue); + + if (userObject is Action) + { + this.LogDebug("Executing Boolean Action"); + (userObject as Action)(args.Sig.BoolValue); + } + else if (userObject is Action) + { + this.LogDebug("Executing Analog Action"); + (userObject as Action)(args.Sig.UShortValue); + } + else if (userObject is Action) + { + this.LogDebug("Executing Serial Action"); + (userObject as Action)(args.Sig.StringValue); + } } catch (Exception e) { @@ -484,7 +494,7 @@ namespace PepperDash.Essentials.Core.Bridges { if (string.IsNullOrEmpty(controlProperties.RoomId)) { - Debug.LogInformation("Unable to build VC-4 EISC Client for device {0}. Room ID is missing or empty", dc.Key); + Debug.LogInformation("Unable to build VC-4 EISC Client for device {deviceKey}. Room ID is missing or empty", dc.Key); eisc = null; break; }