From 21faed417b91748827bc8f87248b51f23a34c3aa Mon Sep 17 00:00:00 2001 From: Nick Genovese Date: Fri, 14 Aug 2026 10:35:07 -0400 Subject: [PATCH] fix: Refactor activation logic and improve logging Replaced Initialize() with CustomActivate() returning a bool for activation success. Added logging for activation and slot usage. Now returns false if slot not found and returns registration status at the end. --- .../Touchpanels/Mpc4Touchpanel.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/PepperDash.Essentials.Core/Touchpanels/Mpc4Touchpanel.cs b/src/PepperDash.Essentials.Core/Touchpanels/Mpc4Touchpanel.cs index a8fa268a..3d1cb5fc 100644 --- a/src/PepperDash.Essentials.Core/Touchpanels/Mpc4Touchpanel.cs +++ b/src/PepperDash.Essentials.Core/Touchpanels/Mpc4Touchpanel.cs @@ -33,8 +33,10 @@ namespace PepperDash.Essentials.Core.Touchpanels _buttons = buttons ?? new Dictionary(); } - public override void Initialize() + public override bool CustomActivate() { + Debug.LogInformation(this, "Activating MPC4 Touchpanel Controller with key {0}", Key); + if (_processor.MPC4x102TouchscreenSlot != null) { Debug.LogMessage(LogEventLevel.Information, this, "Using MPC4x102TouchscreenSlot"); @@ -58,7 +60,7 @@ namespace PepperDash.Essentials.Core.Touchpanels else { Debug.LogMessage(LogEventLevel.Error, this, "Failed to find MPC4 Touchpanel Controller with key {0}, check configuration", Key); - return; + return false; } if (_touchpanel.Registerable) @@ -81,6 +83,8 @@ namespace PepperDash.Essentials.Core.Touchpanels } ListButtons(); + + return _touchpanel.Registered; } ///