Finishes converting all existing types to new DeviceFactory mechanism. #106

This commit is contained in:
Neil Dorin
2020-04-22 16:17:07 -06:00
parent 2170a79399
commit 4f6ae386b4
29 changed files with 626 additions and 334 deletions

View File

@@ -7,6 +7,7 @@ using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Routing;
using Feedback = PepperDash.Essentials.Core.Feedback;
@@ -361,4 +362,23 @@ namespace PepperDash.Essentials.Devices.Displays
#endregion
}
public class NecPSXMDisplayFactory : EssentialsDeviceFactory<NecPSXMDisplay>
{
public NecPSXMDisplayFactory()
{
TypeNames = new List<string>() { "necmpsx" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new Generic Comm Device");
var comm = CommFactory.CreateCommForDevice(dc);
if (comm != null)
return new NecPSXMDisplay(dc.Key, dc.Name, comm);
else
return null;
}
}
}