Skip to content

Add hdmd nx m4kze support#25

Draft
jkdevito wants to merge 51 commits intomainfrom
add-hdmdNxM4kze-support
Draft

Add hdmd nx m4kze support#25
jkdevito wants to merge 51 commits intomainfrom
add-hdmdNxM4kze-support

Conversation

@jkdevito
Copy link
Contributor

No description provided.

- Remove the obsolete HdMdNxM4Ke class.
- Rename HdMdNxM4KeBridgeableController to HdMdNxM4Ke.
- Add `hdmd4x14ke` to the supported types.
- Keep `hdmd4x14ke-bridgeable` as a supported type for backward compatibility.

BREAKING CHANGE: Remove the obsolete HdMd4NxM4ke class.
@jkdevito jkdevito self-assigned this Jan 16, 2026
@jkdevito jkdevito added the enhancement New feature or request label Jan 16, 2026
@jkdevito jkdevito linked an issue Jan 16, 2026 that may be closed by this pull request
@jkdevito jkdevito marked this pull request as draft January 16, 2026 20:14
Copy link

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 adds support for HdMdNxM4kE switchers to the plugin by refactoring the existing HdMdNxM4kEController class from an obsolete implementation to a new bridgeable controller that supports multiple switcher models (HdMd4x14kE, HdMd4x24kE, and HdMd6x24kE). The changes consolidate configuration classes and update the factory pattern to support additional device types.

Changes:

  • Refactored HdMdNxM4kEController from obsolete to fully bridgeable implementation with feedback collections
  • Unified configuration by removing duplicate HdMdNxM4kEBridgeablePropertiesConfig class
  • Added support for multiple switcher models through enhanced factory pattern

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 13 comments.

File Description
src/PepperDash.Essentials.DM.csproj Whitespace and indentation cleanup
src/Config/HdMdNxM4kEPropertiesConfig.cs Consolidated config classes, removed duplicate HdMdNxM4kEBridgeablePropertiesConfig, added NoRouteText property
src/Chassis/HdMdNxM4kEController.cs Complete rewrite from obsolete implementation to bridgeable controller with feedback support and factory for multiple models
src/Chassis/HdMdNxM4KzEController.cs Updated ZE controller with consistent naming, improved null handling, and updated factory
Comments suppressed due to low confidence (1)

src/Chassis/HdMdNxM4KzEController.cs:21

  • Field '_Chassis' can be 'readonly'.

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

Comment on lines 225 to 251
foreach (FeedbackCollection<BoolFeedback> fbCollection in newFbs)
{
foreach (var item in newFbs)
{
AddCollectionToList(item);
}
}
}
public void AddCollectionsToList(params FeedbackCollection<IntFeedback>[] newFbs)
{
foreach (FeedbackCollection<IntFeedback> fbCollection in newFbs)
{
foreach (var item in newFbs)
{
AddCollectionToList(item);
}
}
}

public void AddCollectionsToList(params FeedbackCollection<StringFeedback>[] newFbs)
{
foreach (FeedbackCollection<StringFeedback> fbCollection in newFbs)
{
foreach (var item in newFbs)
{
AddCollectionToList(item);
}
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The inner loop iterates over newFbs instead of fbCollection. This causes the outer loop variable fbCollection to be unused and the inner loop to process the entire newFbs array multiple times. Change foreach (var item in newFbs) to foreach (var item in fbCollection). The same bug exists in the IntFeedback and StringFeedback overloads on lines 237-239 and 248-250.

Suggested change
foreach (FeedbackCollection<BoolFeedback> fbCollection in newFbs)
{
foreach (var item in newFbs)
{
AddCollectionToList(item);
}
}
}
public void AddCollectionsToList(params FeedbackCollection<IntFeedback>[] newFbs)
{
foreach (FeedbackCollection<IntFeedback> fbCollection in newFbs)
{
foreach (var item in newFbs)
{
AddCollectionToList(item);
}
}
}
public void AddCollectionsToList(params FeedbackCollection<StringFeedback>[] newFbs)
{
foreach (FeedbackCollection<StringFeedback> fbCollection in newFbs)
{
foreach (var item in newFbs)
{
AddCollectionToList(item);
}
foreach (var fbCollection in newFbs)
{
AddCollectionToList(fbCollection);
}
}
public void AddCollectionsToList(params FeedbackCollection<IntFeedback>[] newFbs)
{
foreach (var fbCollection in newFbs)
{
AddCollectionToList(fbCollection);
}
}
public void AddCollectionsToList(params FeedbackCollection<StringFeedback>[] newFbs)
{
foreach (var fbCollection in newFbs)
{
AddCollectionToList(fbCollection);

Copilot uses AI. Check for mistakes.
Comment on lines 237 to 240
foreach (var item in newFbs)
{
AddCollectionToList(item);
}
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The inner loop iterates over newFbs instead of fbCollection. Change foreach (var item in newFbs) to foreach (var item in fbCollection).

Copilot uses AI. Check for mistakes.
Comment on lines 248 to 251
foreach (var item in newFbs)
{
AddCollectionToList(item);
}
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The inner loop iterates over newFbs instead of fbCollection. Change foreach (var item in newFbs) to foreach (var item in fbCollection).

Copilot uses AI. Check for mistakes.
- improve chassis null handling
- update feedback collection methods
- Removed `Bridgeable` from controller class name
- Added Key and Name to DmCardAudioOutputController and DmpsAudioOutputController to resolve plugin factory exceptions:

```
Loading plugin factory: PepperDash.Essentials.DM
Load Plugin not found. PepperDash.Essentials.DM.DmpsAudioOutputWithMixerAndEq is not a plugin factory. Exception: Could not set up parent class, due to: Parent class vtable failed to initialize, due to: VTable setup of type PepperDash.Essentials.DM.DmpsAudioOutput failed assembly:/user/program1/plugins/loadedAssemblies/PepperDash.Essentials.DM.dll type:DmpsAudioOutput member:(null) assembly:/user/program1/plugins/loadedAssemblies/PepperDash.Essentials.DM.dll type:DmpsAudioOutputWithMixer member:(null)
Load Plugin not found. PepperDash.Essentials.DM.DmpsAudioOutputWithMixer is not a plugin factory. Exception: Parent class vtable failed to initialize, due to: VTable setup of type PepperDash.Essentials.DM.DmpsAudioOutput failed assembly:/user/program1/plugins/loadedAssemblies/PepperDash.Essentials.DM.dll type:DmpsAudioOutput member:(null)
Load Plugin not found. PepperDash.Essentials.DM.DmpsAudioOutput is not a plugin factory. Exception: VTable setup of type PepperDash.Essentials.DM.DmpsAudioOutput failed
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]-Add support for HD-MDNxM-4KZ-E devices

1 participant