mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-13 19:54:59 +00:00
fixes issues determining Interface type
This commit is contained in:
@@ -110,30 +110,37 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
if (device == null) continue;
|
if (device == null) continue;
|
||||||
|
|
||||||
Debug.Console(1, this, "Linking Device: '{0}'", device.Key);
|
Debug.Console(1, this, "Linking Device: '{0}'", device.Key);
|
||||||
|
if (device is IBridge) // Check for this first to allow bridges in plugins to override existing bridges that apply to the same type.
|
||||||
if (device.GetType().GetCType().IsAssignableFrom(typeof (IBridge)))
|
|
||||||
{
|
{
|
||||||
var bridge = device as IBridge;
|
Debug.Console(2, this, "'{0}' is IBridge", device.Key);
|
||||||
|
(device as IBridge).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||||
if (bridge != null) bridge.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
else if (device is IBridgeAdvanced)
|
||||||
if (!device.GetType().GetCType().IsAssignableFrom(typeof (IBridgeAdvanced))) continue;
|
{
|
||||||
|
Debug.Console(2, this, "'{0}' is IBridgeAdvanced", device.Key);
|
||||||
var bridgeAdvanced = device as IBridgeAdvanced;
|
(device as IBridgeAdvanced).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
|
||||||
if (bridgeAdvanced != null) bridgeAdvanced.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
|
}
|
||||||
|
//if (device.GetType().GetCType().IsAssignableFrom(typeof (IBridge)))
|
||||||
//if (device is IBridge) // Check for this first to allow bridges in plugins to override existing bridges that apply to the same type.
|
|
||||||
//{
|
//{
|
||||||
// (device as IBridge).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
// var bridge = device as IBridge;
|
||||||
|
|
||||||
|
// if (bridge == null)
|
||||||
|
// continue;
|
||||||
|
// Debug.Console(2, this, "Linking device {0} as IBridge");
|
||||||
|
// bridge.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||||
// continue;
|
// continue;
|
||||||
//}
|
//}
|
||||||
//else if (device is IBridgeAdvanced)
|
|
||||||
//{
|
//if (!device.GetType().GetCType().IsAssignableFrom(typeof (IBridgeAdvanced))) continue;
|
||||||
// Debug.Console(2, this, "'{0}' is IBridgeAdvanced", device.Key);
|
|
||||||
// (device as IBridgeAdvanced).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
|
//var bridgeAdvanced = device as IBridgeAdvanced;
|
||||||
//}
|
|
||||||
|
//if (bridgeAdvanced == null) continue;
|
||||||
|
//Debug.Console(2, this, "Linking device {0} as IBridgeAdvanced");
|
||||||
|
//bridgeAdvanced.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
|
||||||
|
}
|
||||||
|
Debug.Console(1, this, "Devices Linked.");
|
||||||
|
//
|
||||||
//else if (device is PepperDash.Essentials.Core.Monitoring.SystemMonitorController)
|
//else if (device is PepperDash.Essentials.Core.Monitoring.SystemMonitorController)
|
||||||
//{
|
//{
|
||||||
// (device as PepperDash.Essentials.Core.Monitoring.SystemMonitorController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
// (device as PepperDash.Essentials.Core.Monitoring.SystemMonitorController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||||
@@ -234,9 +241,9 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
// (device as C2nRthsController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
// (device as C2nRthsController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||||
// continue;
|
// continue;
|
||||||
//}
|
//}
|
||||||
}
|
//}
|
||||||
|
|
||||||
|
|
||||||
Debug.Console(1, this, "Devices Linked.");
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user