Updating more device factories in Essentials and Devices.Common

This commit is contained in:
Neil Dorin
2020-04-20 23:12:27 -06:00
parent 2839e4676c
commit d3562bf22d
28 changed files with 617 additions and 497 deletions

View File

@@ -94,6 +94,13 @@ namespace PepperDash.Essentials
// Instantiate the Device Factories
new CoreDeviceFactory();
new DmDeviceFactory();
new UiDeviceFactory();
new DeviceFactory();
new BridgeFactory();
new PepperDash.Essentials.Devices.Common.DeviceFactory();
}
@@ -365,32 +372,15 @@ namespace PepperDash.Essentials
}
// Try local factories first
var newDev = DeviceFactory.GetDevice(devConf);
IKeyed newDev = null;
if (newDev == null)
newDev = BridgeFactory.GetDevice(devConf);
// Then associated library factories
if (newDev == null)
newDev = PepperDash.Essentials.Core.DeviceFactory.GetDevice(devConf);
if (newDev == null)
newDev = PepperDash.Essentials.Devices.Common.DeviceFactory.GetDevice(devConf);
//
if (newDev == null)
newDev = PepperDash.Essentials.Devices.Displays.DisplayDeviceFactory.GetDevice(devConf);
//if (newDev == null) // might want to consider the ability to override an essentials "type"
//{
// // iterate plugin factories
// foreach (var f in FactoryObjects)
// {
// var cresFactory = f as IGetCrestronDevice;
// if (cresFactory != null)
// {
// newDev = cresFactory.GetDevice(devConf, this);
// }
// }
//}
//
if (newDev != null)
DeviceManager.AddDevice(newDev);