From 061d95e2b1bea0f0fdd5aacaf49c65be3961b099 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Mon, 9 Sep 2019 16:13:25 -0600 Subject: [PATCH] Moves IBridge condition to the top of the list to allow plugin bridges to override existing ones. --- PepperDashEssentials/Bridges/BridgeBase.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PepperDashEssentials/Bridges/BridgeBase.cs b/PepperDashEssentials/Bridges/BridgeBase.cs index 462ba981..f1a24f86 100644 --- a/PepperDashEssentials/Bridges/BridgeBase.cs +++ b/PepperDashEssentials/Bridges/BridgeBase.cs @@ -78,7 +78,12 @@ namespace PepperDash.Essentials.Bridges if (device != null) { - if (device is PepperDash.Essentials.Core.Monitoring.SystemMonitorController) + if (device is IBridge) // Check for this first to allow bridges in plugins to override existing bridges that apply to the same type. + { + (device as IBridge).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey); + continue; + } + else if (device is PepperDash.Essentials.Core.Monitoring.SystemMonitorController) { (device as PepperDash.Essentials.Core.Monitoring.SystemMonitorController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey); continue; @@ -138,11 +143,6 @@ namespace PepperDash.Essentials.Bridges (device as AppleTV).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey); continue; } - else if (device is IBridge) - { - (device as IBridge).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey); - continue; - } else if (device is HdMdxxxCEController) { (device as HdMdxxxCEController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);