Skip to content

Feature/web api updates#1433

Open
equinoy wants to merge 19 commits into
mainfrom
feature/web-api-updates
Open

Feature/web api updates#1433
equinoy wants to merge 19 commits into
mainfrom
feature/web-api-updates

Conversation

@equinoy

@equinoy equinoy commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces two new device interface contracts for wireless sharing and network switch management, and makes several improvements and cleanups in routing, web API, and messaging code. The most significant changes are the addition of standardized interfaces for wireless sharing and network switch VLAN/PoE control, along with the removal of the route impossibility cache and related code in routing extensions. There are also improvements to the web API's device feedback handler and adjustments to JSON serialization for device messages.

New device interface contracts:

  • Added IHasWirelessSharing interface and related WirelessSharingEventArgs class to standardize detection and eventing of wireless presentation activity across devices like AirMedia, Solstice, etc. (IHasWirelessSharing.cs)
  • Introduced INetworkSwitchVlanManager, INetworkSwitchPoeManager, and INetworkSwitchPoeVlanManager interfaces, along with supporting event argument and enum types, to provide a unified API for network switch VLAN and PoE management. (INetworkSwitchControl.cs)

Routing and tie line improvements:

  • Removed the impossible routes cache and all related logic from Extensions.cs, simplifying the routing code and removing unnecessary complexity. [1] [2] [3] [4] [5]
  • Improved filtering and logging in the MapDestinationsToSources method to exclude devices implementing both input and output interfaces from source/sink lists, and added verbose logging for mapped routes. [1] [2] [3] [4]

Web API and messaging enhancements:

  • Updated the device feedbacks web handler to return a 200 OK with empty arrays (instead of a 404) when a device is not found, improving API consistency and client experience. (GetFeedbacksForDeviceRequestHandler.cs)
  • Modified JSON serialization attributes in DeviceMessageBase and DeviceStateMessageBase to ignore null values and marked the Interfaces property as obsolete, reflecting changes in how device interfaces are reported. [1] [2] [3]

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

This PR adds standardized device interface contracts for wireless sharing and network switch port management, and refactors core routing plus a small Web API behavior/serialization tweak to improve consistency and reduce legacy payload noise.

Changes:

  • Added new device contracts: IHasWirelessSharing (+ event args) and network switch VLAN/PoE manager interfaces (+ event args/enum).
  • Simplified routing discovery by removing the “impossible routes” cache and refining route-mapping device filtering/logging.
  • Updated MobileControl/AppServer JSON serialization to ignore nulls and adjusted the feedbacks Web API handler to return 200 OK with empty arrays when a device key isn’t found.

Reviewed changes

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

Show a summary per file
File Description
src/PepperDash.Essentials.MobileControl.Messengers/Messengers/DeviceStateMessageBase.cs Marks legacy Interfaces payload obsolete and avoids emitting it when null.
src/PepperDash.Essentials.MobileControl.Messengers/Messengers/DeviceMessageBase.cs Ignores nulls for common device-message JSON fields.
src/PepperDash.Essentials.Core/Web/RequestHandlers/GetFeedbacksForDeviceRequestHandler.cs Returns 200 OK with an empty JSON payload when the device isn’t found.
src/PepperDash.Essentials.Core/Routing/Extensions.cs Removes route-impossibility caching and adjusts route mapping/filtering/logging.
src/PepperDash.Essentials.Core/DeviceTypeInterfaces/INetworkSwitchControl.cs Introduces VLAN/PoE management interfaces and supporting event types.
src/PepperDash.Essentials.Core/DeviceTypeInterfaces/IHasWirelessSharing.cs Introduces a contract for wireless sharing state feedback + change event.
Comments suppressed due to low confidence (1)

src/PepperDash.Essentials.Core/Routing/Extensions.cs:354

  • sinks and sources are already filtered to exclude IRoutingInputsOutputs and materialized with ToList(), but the nested foreach loops re-apply the same Where filters. This is redundant and adds extra enumeration inside a very hot nested loop.
                foreach (var sink in sinks.Where(d => !(d is IRoutingInputsOutputs)))
                {
                    foreach (var source in sources.Where(d => !(d is IRoutingInputsOutputs)))
                    {

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

equinoy and others added 4 commits June 15, 2026 10:05
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

8 participants