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

@@ -10,7 +10,7 @@ using PepperDash.Essentials.Devices.Common.Codec;
namespace PepperDash.Essentials.Devices.Common.AudioCodec
{
public abstract class AudioCodecBase : Device, IHasDialer, IUsageTracking, IAudioCodecInfo
public abstract class AudioCodecBase : EssentialsDevice, IHasDialer, IUsageTracking, IAudioCodecInfo
{
public event EventHandler<CodecCallStatusItemChangeEventArgs> CallStatusChange;

View File

@@ -6,6 +6,7 @@ using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Devices.Common.Codec;
namespace PepperDash.Essentials.Devices.Common.AudioCodec
@@ -111,4 +112,20 @@ namespace PepperDash.Essentials.Devices.Common.AudioCodec
}
}
}
public class MockACFactory : EssentialsDeviceFactory<MockAC>
{
public MockACFactory()
{
TypeNames = new List<string>() { "mockac" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new MockAc Device");
var props = Newtonsoft.Json.JsonConvert.DeserializeObject<AudioCodec.MockAcPropertiesConfig>(dc.Properties.ToString());
return new AudioCodec.MockAC(dc.Key, dc.Name, props);
}
}
}