From 826b7fd6d5dab86bde061451f09f848c35dace45 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 15 May 2024 15:30:54 -0500 Subject: [PATCH] fix: add factory for mock display in Devices.Common --- .../Displays/MockDisplay.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/PepperDash.Essentials.Devices.Common/Displays/MockDisplay.cs b/src/PepperDash.Essentials.Devices.Common/Displays/MockDisplay.cs index a1241821..bcbbaa5a 100644 --- a/src/PepperDash.Essentials.Devices.Common/Displays/MockDisplay.cs +++ b/src/PepperDash.Essentials.Devices.Common/Displays/MockDisplay.cs @@ -6,6 +6,7 @@ using Crestron.SimplSharpPro.DeviceSupport; using PepperDash.Core; using PepperDash.Essentials.Core; using PepperDash.Essentials.Core.Bridges; +using PepperDash.Essentials.Core.Config; using PepperDash.Essentials.Core.DeviceTypeInterfaces; using PepperDash.Essentials.Core.Routing; using Serilog.Events; @@ -251,4 +252,18 @@ namespace PepperDash.Essentials.Devices.Common.Displays } + + public class MockDisplayFactory : EssentialsDeviceFactory + { + public MockDisplayFactory() + { + TypeNames = new List() { "mockdisplay2" }; + } + + public override EssentialsDevice BuildDevice(DeviceConfig dc) + { + Debug.LogMessage(LogEventLevel.Debug, "Factory Attempting to create new Mock Display Device"); + return new MockDisplay(dc.Key, dc.Name); + } + } } \ No newline at end of file