Skip to content

Conversation

@andrew-welker
Copy link
Contributor

@andrew-welker andrew-welker commented Dec 31, 2025

This pull request makes significant improvements to the organization and extensibility of the audio and volume control interfaces in the PepperDash.Essentials.Core project. It refactors and modularizes the various audio-related interfaces into individual files, introduces new interfaces for advanced audio control, and enhances the Fusion room configuration process with improved custom property handling and configurability.

Audio/Volume Interface Refactoring and Enhancements:

  • All audio and volume-related interfaces have been split out from IVolumeAndAudioInterfaces.cs into individual, focused files under DeviceTypeInterfaces, improving code organization and maintainability. These interfaces include IBasicVolumeControls, IBasicVolumeWithFeedback, IBasicVolumeWithFeedbackAdvanced, IFullAudioSettings, IHasVolumeControl, IHasMuteControl, IHasVolumeDevice, IHasCurrentVolumeControls, IAudioZone, IAudioZones, and the eVolumeLevelUnits enum. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]
  • The legacy IVolumeAndAudioInterfaces.cs file has been removed, with all relevant code now distributed across the new interface files.

Fusion Room Custom Property Handling:

  • The FusionCustomPropertiesBridge.EvaluateRoomInfo method has been refactored to accept the IEssentialsRoom object, the RoomInformation, and a new useFusionRoomName boolean parameter, allowing the option to skip updating the room name from Fusion if desired. This prevents unintended changes when multiple Fusion instances are present. [1] [2]
  • Improved error handling and logging in the Fusion custom property mapping process, including more descriptive debug and error messages.

Fusion Room Configuration Improvements:

  • Added a new useFusionRoomName property (defaulting to true) to IEssentialsRoomFusionControllerPropertiesConfig, giving integrators control over whether the Fusion room name should overwrite the configured room name.
  • Updated the Fusion controller to use the new EvaluateRoomInfo signature, passing in the room object and the useFusionRoomName configuration.

General Codebase Clean-up:

  • Updated using directives and removed unnecessary usings in several files for clarity and consistency. [1] [2] [3] [4]

Tooling:

  • Added a .config/dotnet-tools.json file specifying the use of the csharpier code formatter, supporting code style consistency.
  • fix: handle threading issues for concurrent clients joining
  • Initial plan
  • Add raise/lower movement time configuration and banked command support
  • Split movement time into separate raise/lower times and remove timing from latched mode
  • Refactor timer disposal and improve code readability
  • fix: move isInUpPosition to momvement complete method, remove conditionlal logic on raise/lower commands
  • fix: add clientId as qp for websocket for MC
  • fix: use .NET timers instead of CTimer
  • fix: fusion controller now sets only associated room custom values
  • fix: use correct property name for isInUpPosition
  • fix: a few logging updates
  • fix: a few logging updates
  • fix: save config only when values change
  • fix: update matrix routing inputs if endpoint online status changes
  • fix: revert prop name to inUpPosition for screenlift messenger
  • fix: implement IKeyName for DspControlPoint

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 addresses multiple issues across the codebase, with the primary focus on fixing threading issues for concurrent WebSocket client connections in the Mobile Control system. Key improvements include implementing thread-safe client registration, refactoring the ScreenLift controller to support timed movements with command banking, and restructuring volume control interfaces for better maintainability.

  • Implements thread-safe WebSocket client registration using concurrent collections and query parameter-based client identification
  • Adds movement timing and command banking support to ScreenLiftController with .NET Timer replacement
  • Refactors volume control interfaces from a single monolithic file into separate, focused interface definitions
  • Adds configuration option to control Fusion room name synchronization and improves custom property mapping

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
src/PepperDash.Essentials/ControlSystem.cs Adds debug logging when multiple configuration files are detected
src/PepperDash.Essentials.MobileControl/WebSocketServer/UiClient.cs Implements new client registration flow with clientId query parameter validation and legacy fallback support
src/PepperDash.Essentials.MobileControl/WebSocketServer/MobileControlWebsocketServer.cs Adds concurrent dictionaries for thread-safe client registration and pending client tracking
src/PepperDash.Essentials.MobileControl/WebSocketServer/JoinResponse.cs Adds WebSocketUrl property to join response for client connection
src/PepperDash.Essentials.MobileControl/Utilities.cs Makes GetNextClientId thread-safe using Interlocked.Increment
src/PepperDash.Essentials.MobileControl/MobileControlSystemController.cs Updates client filtering to use TokenKey instead of Token string comparison
src/PepperDash.Essentials.MobileControl.Messengers/Messengers/IMatrixRoutingMessenger.cs Subscribes to input slot online status changes for routing updates
src/PepperDash.Essentials.MobileControl.Messengers/Messengers/DeviceVolumeMessenger.cs Removes unnecessary IKeyName cast since IBasicVolumeControls now extends IKeyName
src/PepperDash.Essentials.Devices.Common/Displays/ScreenLiftRelaysConfig.cs Adds MoveTimeInMs configuration property for movement timing
src/PepperDash.Essentials.Devices.Common/Displays/ScreenLiftController.cs Replaces CTimer with System.Timers.Timer, implements movement tracking and command banking
src/PepperDash.Essentials.Devices.Common/DSP/DspBase.cs Implements IKeyName interface for DspControlPoint base class
src/PepperDash.Essentials.Core/Routing/RoutingFeedbackManager.cs Updates log levels and applies code formatting improvements
src/PepperDash.Essentials.Core/Fusion/IEssentialsRoomFusionControllerPropertiesConfig.cs Adds UseFusionRoomName configuration flag to control room name synchronization
src/PepperDash.Essentials.Core/Fusion/IEssentialsRoomFusionController.cs Passes room object instead of room key to custom properties bridge
src/PepperDash.Essentials.Core/Fusion/FusionCustomPropertiesBridge.cs Refactors to apply custom properties only to the associated room, preventing cross-room contamination
src/PepperDash.Essentials.Core/Devices/IVolumeAndAudioInterfaces.cs Deletes monolithic interface file as part of interface refactoring
src/PepperDash.Essentials.Core/DeviceTypeInterfaces/*.cs Splits volume and audio interfaces into separate, focused files for better organization
.config/dotnet-tools.json Adds CSharpier code formatter tool configuration

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

@ngenovese11 ngenovese11 merged commit 3fb30d5 into main Dec 31, 2025
8 checks passed
@ngenovese11 ngenovese11 deleted the matrix-routing-isonline branch December 31, 2025 20:19
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.

4 participants