feat!: migrate plugin to Essentials v3 (net8)#32
Conversation
- Update TargetFramework from net472 to net8 - Update PepperDashEssentials NuGet to 3.0.0-dev-v3-testing.13 - Update MinimumEssentialsFrameworkVersion to 3.0.0 in all factories - Remove unused Crestron.SimplSharp.Reflection import - Remove obsolete framework references (System.Data.DataSetExtensions, Microsoft.CSharp, System.Net.Http) - Change CustomActivate() from public to protected override (v3 base class change) - Replace eRoutingSignalType.UsbInput/UsbOutput with eRoutingSignalType.Usb (removed in v3) - Replace eRoutingSignalType.SecondaryAudio with eRoutingSignalType.AudioVideo (removed in v3) - Add IKeyName/IKeyed implementation to DmpsAudioOutput and DmCardAudioOutputController - Replace Debug.Console(0,...) with Debug.LogInformation() in HdMdNxM4kEController BREAKING CHANGE: Plugin now targets net8 and requires Essentials v3. Not compatible with Essentials v2 (net472) runtime.
- Add xUnit test project with MetadataLoadContext-based assembly inspection - Factory discovery tests: verify all 12 factories are discoverable with parameterless constructors - Factory metadata tests: validate MinimumEssentialsFrameworkVersion=3.0.0 and TypeNames registration - Config deserialization tests: verify JSON property contracts on all config classes - Fix HdMdNxM4kEFactory missing MinimumEssentialsFrameworkVersion (caught by tests) 74 tests, all passing
Resolves #33. The direct dictionary access threw KeyNotFoundException when inputSlotSupportsHdcp2 config entries were not present for all HDMI input slots. Now uses TryGetValue (defaulting to false), consistent with the pattern already used in LinkBasicTxToApi. Also added ContainsKey guard for InputCardHdcpStateFeedbacks.
|
@anthony-lopez-pd this looks great so far! I approved but see it's still marked as draft. Let me know when it's ready for review. |
Add HdMdNxM4kzEController for the 4KZ-E switcher family (HdMd4x14kzE, HdMd4x24kzE, HdMd4x44kzE, HdMd8x44kzE, HdMd8x84kzE). New standalone controller uses correct 2-arg constructor and 4KZ-E-specific input/output types (HdMdNxM4kzEHdmiInput/Output), fixing the feedback bug from the previous branch. Includes HdMdNxM4kzEPropertiesConfig and factory with all 5 type names. Updated tests: factory count 12->13, 5 type name metadata tests, config deserialization tests.
|
@copilot review please |
- Replace direct PropertiesConfig.InputSlotSupportsHdcp2[slot] access with TryGetValue in InputCardHdcpStateFeedbacks lambdas (3 locations) to prevent KeyNotFoundException when config entries are missing - Remove duplicate eRoutingSignalType.Usb condition in DmpsRoutingController sigTypeIsUsbOrVideo (was checking Usb twice, a copy-paste artefact of the UsbInput→Usb + UsbOutput→Usb migration) - Replace redundant isUsbInput/isUsbOutput variables (both identical after v3 migration) with single isUsb in DmChassisController.ExecuteSwitch - Extract dead UsbOutput branch from ExecuteNumericSwitch (was unreachable because both UsbInput and UsbOutput conditions collapsed to the same Usb flag after v3 migration) into new private ExecuteUsbOutputSwitch helper, restoring correct output-slot USB routing - Route OutputUsb API join through ExecuteUsbOutputSwitch instead of ExecuteNumericSwitch so it routes to Chassis.Outputs[slot] as originally intended, not Chassis.Inputs[slot] Agent-Logs-Url: https://github.com/PepperDash/PepperDash.Essentials.DM/sessions/1775755d-cfd5-4aea-982a-15f27bcd33a4 Co-authored-by: anthony-lopez-pd <206736292+anthony-lopez-pd@users.noreply.github.com>
- Extract magic number 16 (8x8 USB output slot offset) into named constant Usb8x8OutputSlotOffset for clarity; used in both ExecuteNumericSwitch and ExecuteUsbOutputSwitch - Improve comment wording on eRoutingSignalType.UsbInput/UsbOutput → Usb note and on the USB input-side routing branch in ExecuteNumericSwitch Agent-Logs-Url: https://github.com/PepperDash/PepperDash.Essentials.DM/sessions/1775755d-cfd5-4aea-982a-15f27bcd33a4 Co-authored-by: anthony-lopez-pd <206736292+anthony-lopez-pd@users.noreply.github.com>
Review done. Found and fixed the following issues in commits Bugs fixed:
Code quality:
All 84 unit tests continue to pass; CodeQL scan found 0 alerts. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Summary
Migrate PepperDash.Essentials.DM plugin from Essentials v2 (net472) to Essentials v3 (net8).
Changes
Project Configuration
Breaking API Fixes
Bug Fixes
PropertiesConfig.InputSlotSupportsHdcp2[ioSlot]threw when config entries were missing for HDMI input slots. Replaced withTryGetValue(defaulting tofalse), consistent with the pattern already used inLinkBasicTxToApi. AddedContainsKeyguard forInputCardHdcpStateFeedbacks.New Feature: HD-MD-NxM-4KZ-E Switcher Support (
938e842)HdMdNxM4kzEController— Standalone bridgeable controller for the 4KZ-E switcher family, implementingIRoutingNumericWithFeedbackandIHasFeedbackhdmd4x14kze,hdmd4x24kze,hdmd4x44kze,hdmd8x44kze,hdmd8x84kze)HdMdNxM4kEBridgeableController— the 4KZ-E models have a different Crestron SDK type hierarchy (HdMdNxM4kzEbase vsHdMdNxM), different constructors (2-arg, no IP address), and different input/output types (HdMdNxM4kzEHdmiInput/HdMdNxM4kzEHdmiOutput)add-hdmdNxM4kze-supportbranch where switching worked but feedback didn't — root cause was casting to wrong types (HdMdNxMHdmiInputinstead ofHdMdNxM4kzEHdmiInput)HdMdNxM4kzEPropertiesConfigconfig class withControl,Inputs,OutputspropertiesHdMdNxM4kEControllerJoinMapfrom Essentials CoreCode Cleanup
Testing Checklist
BREAKING CHANGE: Plugin now targets net8 and requires Essentials v3. Not compatible with Essentials v2 (net472) runtime.