Skip to content

Conversation

@jkdevito
Copy link
Contributor

@jkdevito jkdevito commented Nov 4, 2025

This pull request refactors the COM port registration logic in the ComPortController to simplify and improve logging, as well as to streamline the registration process. The most important changes are:

COM port registration and configuration improvements:

  • Simplified the registration logic by calling Port.Register() directly, removing the check for Registerable and the need to cast the parent to GenericBase. This makes the registration process more straightforward and less error-prone.
  • Enhanced logging for COM port registration and configuration by updating messages to include more context (such as the port type and ID), and by using consistent log levels and message formats for success and error cases.

Dependency updates:

  • Added missing using directives for Crestron.SimplSharp, Crestron.SimplSharpPro.GeneralIO, and removed unnecessary comments, ensuring all dependencies are properly included.

@jkdevito jkdevito self-assigned this Nov 4, 2025
Copilot AI review requested due to automatic review settings November 4, 2025 15:54
@andrew-welker andrew-welker merged commit 42444ed into main Nov 4, 2025
6 checks passed
@andrew-welker andrew-welker deleted the comport-controller-updates branch November 4, 2025 15:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the COM port registration logic in the ComPortController class, simplifying the registration flow and improving error messages.

  • Simplified COM port registration by directly calling Port.Register() instead of checking parent device registration
  • Removed unnecessary parent device type checks and conditional logic
  • Cleaned up error and information log messages by removing "ERROR:" and "INFO:" prefixes
  • Added new using statements for Crestron.SimplSharp and Crestron.SimplSharpPro.GeneralIO

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

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.

3 participants