feat: added cen-io-ir-104 device and factory

This commit is contained in:
Jason DeVito
2022-08-30 21:53:41 -05:00
parent e5393deea8
commit 074ee190ad
2 changed files with 63 additions and 0 deletions

View File

@@ -0,0 +1,62 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.GeneralIO;
using PepperDash.Essentials.Core.Config;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// Wrapper class for CEN-IO-IR-104 module
/// </summary>
[Description("Wrapper class for the CEN-IO-IR-104 module")]
public class CenIoIr104Controller : EssentialsDevice, IIROutputPorts
{
public CenIoIr104 Ir104 { get; private set; }
public CenIoIr104Controller(string key, string name, CenIoIr104 ir104)
: base(key, name)
{
Ir104 = ir104;
}
#region IDigitalInputPorts Members
public CrestronCollection<IROutputPort> IROutputPorts
{
get { return Ir104.IROutputPorts; }
}
public int NumberOfIROutputPorts
{
get { return Ir104.NumberOfIROutputPorts; }
}
#endregion
}
public class CenIoIr104ControllerFactory : EssentialsDeviceFactory<CenIoIr104Controller>
{
public CenIoIr104ControllerFactory()
{
TypeNames = new List<string>() { "cenioir104" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new CEN-IR-104 Device");
var control = CommFactory.GetControlPropertiesConfig(dc);
var ipid = control.IpIdInt;
return new CenIoIr104Controller(dc.Key, dc.Name, new Crestron.SimplSharpPro.GeneralIO.CenIoIr104(ipid, Global.ControlSystem));
}
}
}

View File

@@ -183,6 +183,7 @@
<Compile Include="Crestron IO\Inputs\GenericVersiportInputDevice.cs" />
<Compile Include="Crestron IO\Inputs\IDigitalInput.cs" />
<Compile Include="Crestron IO\IOPortConfig.cs" />
<Compile Include="Crestron IO\Ir\CenIoIr104Controller.cs" />
<Compile Include="Crestron IO\Relay\CenIoRy104Controller.cs" />
<Compile Include="Crestron IO\Relay\GenericRelayDevice.cs" />
<Compile Include="Crestron IO\Relay\ISwitchedOutput.cs" />