From 8c56623641dc694ad04b8fbb053a958f96b0d686 Mon Sep 17 00:00:00 2001 From: Nick Genovese Date: Wed, 12 Aug 2026 14:17:50 -0400 Subject: [PATCH] fix: Support multiple MPC4 touchscreen slot types in ctor Updated Mpc4TouchpanelController constructor to assign _touchpanel from the first available slot among MPC4x102, MPC4x201, MPC4x301, or MPC4x302 touchscreen slots, improving compatibility with various MPC4 touchscreen models. --- .../Touchpanels/Mpc4Touchpanel.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/PepperDash.Essentials.Core/Touchpanels/Mpc4Touchpanel.cs b/src/PepperDash.Essentials.Core/Touchpanels/Mpc4Touchpanel.cs index 4d16f184..85a7b987 100644 --- a/src/PepperDash.Essentials.Core/Touchpanels/Mpc4Touchpanel.cs +++ b/src/PepperDash.Essentials.Core/Touchpanels/Mpc4Touchpanel.cs @@ -28,7 +28,22 @@ namespace PepperDash.Essentials.Core.Touchpanels public Mpc4TouchpanelController(string key, string name, CrestronControlSystem processor, Dictionary buttons) : base(key, name) { - _touchpanel = processor.ControllerTouchScreenSlotDevice as MPC3Basic; + if (processor.MPC4x102TouchscreenSlot != null) + { + _touchpanel = processor.MPC4x102TouchscreenSlot; + } + else if (processor.MPC4x201TouchscreenSlot != null) + { + _touchpanel = processor.MPC4x201TouchscreenSlot; + } + else if (processor.MPC4x301TouchscreenSlot != null) + { + _touchpanel = processor.MPC4x301TouchscreenSlot; + } + else if (processor.MPC4x302TouchscreenSlot != null) + { + _touchpanel = processor.MPC4x302TouchscreenSlot; + } if (_touchpanel == null) {