mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-13 11:44:54 +00:00
Updating more device factories in Essentials and Devices.Common
This commit is contained in:
@@ -11,6 +11,7 @@ using Crestron.SimplSharp.Net.Http;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common
|
||||
@@ -337,4 +338,20 @@ namespace PepperDash.Essentials.Devices.Common
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class DigitalLoggerFactory : EssentialsDeviceFactory<DigitalLogger>
|
||||
{
|
||||
public DigitalLoggerFactory()
|
||||
{
|
||||
TypeNames = new List<string>() { "digitallogger" };
|
||||
}
|
||||
|
||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||
{
|
||||
Debug.Console(1, "Factory Attempting to create new DigitalLogger Device");
|
||||
var props = JsonConvert.DeserializeObject<DigitalLoggerPropertiesConfig>(
|
||||
dc.Properties.ToString());
|
||||
return new DigitalLogger(dc.Key, dc.Name, props);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user