mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-13 04:26:49 +00:00
Updates device factory methodology for Essentials Core and Essential DM libraries
This commit is contained in:
parent
f75d884986
commit
c5232ca6b8
12 changed files with 242 additions and 124 deletions
|
|
@ -1,14 +1,16 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.GeneralIO;
|
||||
using Newtonsoft.Json;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
|
||||
namespace PepperDash.Essentials.Core.CrestronIO
|
||||
{
|
||||
public class StatusSignController:CrestronGenericBridgeableBaseDevice
|
||||
public class StatusSignController : CrestronGenericBridgeableBaseDevice
|
||||
{
|
||||
private readonly StatusSign _device;
|
||||
|
||||
|
|
@ -158,4 +160,22 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
|||
device.SetColor(redBrightness, greenBrightness, blueBrightness);
|
||||
}
|
||||
}
|
||||
|
||||
public class StatusSignControllerFactory : EssentialsDeviceFactory<GenericComm>
|
||||
{
|
||||
public StatusSignControllerFactory()
|
||||
{
|
||||
TypeNames = new List<string>() { "statussign" };
|
||||
}
|
||||
|
||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||
{
|
||||
Debug.Console(1, "Factory Attempting to create new StatusSign Device");
|
||||
|
||||
var control = CommFactory.GetControlPropertiesConfig(dc);
|
||||
var cresnetId = control.CresnetIdInt;
|
||||
|
||||
return new StatusSignController(dc.Key, dc.Name, new StatusSign(cresnetId, Global.ControlSystem));
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue