mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-06 08:16:11 +00:00
fix: ReleaseRoute callse ExecuteSwitch with null for input selector
Most devices that implement IRouting will now need to handle the possiblity of a null as the input selector, with the idea being that a null input selector should clear the route to whatever device is selected as the input selector. This may change to a typed value in the future.
This commit is contained in:
@@ -60,10 +60,12 @@ namespace PepperDash.Essentials.Core
|
||||
/// </summary>
|
||||
public void ReleaseRoutes()
|
||||
{
|
||||
foreach (var route in Routes)
|
||||
foreach (var route in Routes.Where(r => r.SwitchingDevice is IRouting))
|
||||
{
|
||||
if (route.SwitchingDevice is IRouting)
|
||||
if (route.SwitchingDevice is IRouting switchingDevice)
|
||||
{
|
||||
switchingDevice.ExecuteSwitch(null, route.OutputPort.Selector, SignalType);
|
||||
|
||||
// Pull the route from the port. Whatever is watching the output's in use tracker is
|
||||
// responsible for responding appropriately.
|
||||
route.OutputPort.InUseTracker.RemoveUser(Destination, "destination-" + SignalType);
|
||||
|
||||
Reference in New Issue
Block a user