Skip to content

feat: add ICommunicationMonitor support to MobileControlTouchpanelController - #1456

Open
jonnyarndt wants to merge 2 commits into
mainfrom
feat/touchpanel-communication-monitor
Open

feat: add ICommunicationMonitor support to MobileControlTouchpanelController#1456
jonnyarndt wants to merge 2 commits into
mainfrom
feat/touchpanel-communication-monitor

Conversation

@jonnyarndt

Copy link
Copy Markdown
Contributor

Summary

Adds ICommunicationMonitor support to MobileControlTouchpanelController so Mobile Control touchpanels (TSW/XPanel/Crestron App instances) can report online/offline health status to the Mobile Control "Tech Controls: Health" page, the same way other ICommunicationMonitor devices already do.

Previously, MobileControlTouchpanelController did not implement ICommunicationMonitor, so MobileControlSystemController.SetupDefaultDeviceMessengers() silently skipped creating a health messenger for it -- touchpanels had no way to surface online/offline state to the frontend, regardless of config.

Changes

  • MobileControlTouchpanelController now implements ICommunicationMonitor.
  • New CommunicationMonitor property (StatusMonitorBase), backed by CrestronGenericBaseCommunicationMonitor wrapping the controller's own BasicTriListWithSmartObject panel -- the same monitor class already used by CrestronGenericBaseDevice, reusing the panel's existing OnlineStatusChange event.
  • CustomActivate() starts the monitor; new Deactivate() override stops it.

Testing

Verified end-to-end on a bench RMC4 processor:

  • Deployed a locally-built Essentials package with this change.
  • Connected an XPanel instance (IP ID 11) to the touchpanel device.
  • Confirmed the corresponding health item on the Tech Controls: Health page went online immediately when the XPanel connected, and transitioned to offline ~60 seconds after disconnecting it -- matching the expected communication-monitor warning timeout behavior.

Notes

  • No breaking changes; purely additive.
  • No config schema changes -- existing touchpanel device configs work unchanged; a device simply needs its key added to the consuming room/frontend's health-device list to be surfaced (unrelated project-side config, not part of this PR).

Copilot AI review requested due to automatic review settings July 30, 2026 21:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds ICommunicationMonitor support to MobileControlTouchpanelController so Mobile Control touchpanels can surface online/offline health status to the Mobile Control “Tech Controls: Health” UI, aligning touchpanels with other monitored devices in the Essentials Mobile Control ecosystem.

Changes:

  • MobileControlTouchpanelController now implements ICommunicationMonitor and exposes a CommunicationMonitor (StatusMonitorBase).
  • Initializes a CrestronGenericBaseCommunicationMonitor around the panel’s OnlineStatusChange event.
  • Starts the monitor in CustomActivate() and stops it in a Deactivate() override.
Comments suppressed due to low confidence (1)

src/PepperDash.Essentials.MobileControl/Touchpanel/MobileControlTouchpanelController.cs:139

  • ICommunicationMonitorMessenger dereferences _communicationMonitor.CommunicationMonitor without null checks. If the touchpanel hardware is null, this current conditional leaves CommunicationMonitor unset, leading to runtime NullReferenceExceptions when messengers are registered. Always assign CommunicationMonitor, using a safe fallback when panel is null.
            if (panel != null)
            {
                CommunicationMonitor = new CrestronGenericBaseCommunicationMonitor(this, panel, 120000, 300000);
            }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants