fix: updated CEN-IO classes inheriting from EssentialsDevice to CrestronGenericBaseDevice to resolve activation issues

This commit is contained in:
jdevito
2022-08-31 14:43:58 -05:00
parent 40cb1b0fcf
commit fb689c4484
3 changed files with 76 additions and 69 deletions

View File

@@ -16,7 +16,7 @@ namespace PepperDash.Essentials.Core
/// Wrapper class for CEN-IO-DIGIN-104 digital input module /// Wrapper class for CEN-IO-DIGIN-104 digital input module
/// </summary> /// </summary>
[Description("Wrapper class for the CEN-IO-DIGIN-104 diginal input module")] [Description("Wrapper class for the CEN-IO-DIGIN-104 diginal input module")]
public class CenIoDigIn104Controller : EssentialsDevice, IDigitalInputPorts public class CenIoDigIn104Controller : CrestronGenericBaseDevice, IDigitalInputPorts
{ {
public CenIoDi104 Di104 { get; private set; } public CenIoDi104 Di104 { get; private set; }
@@ -53,9 +53,16 @@ namespace PepperDash.Essentials.Core
Debug.Console(1, "Factory Attempting to create new CEN-DIGIN-104 Device"); Debug.Console(1, "Factory Attempting to create new CEN-DIGIN-104 Device");
var control = CommFactory.GetControlPropertiesConfig(dc); var control = CommFactory.GetControlPropertiesConfig(dc);
if (control == null)
{
Debug.Console(1, "Factory failed to create a new CEN-DIGIN-104 Device, control properties not found");
return null;
}
var ipid = control.IpIdInt; var ipid = control.IpIdInt;
if (ipid != 0) return new CenIoDigIn104Controller(dc.Key, dc.Name, new CenIoDi104(ipid, Global.ControlSystem));
return new CenIoDigIn104Controller(dc.Key, dc.Name, new Crestron.SimplSharpPro.GeneralIO.CenIoDi104(ipid, Global.ControlSystem)); Debug.Console(1, "Factory failed to create a new CEN-IO-IR-104 Device using IP-ID-{0}", ipid);
return null;
} }
} }

View File

@@ -16,7 +16,7 @@ namespace PepperDash.Essentials.Core
/// Wrapper class for CEN-IO-IR-104 module /// Wrapper class for CEN-IO-IR-104 module
/// </summary> /// </summary>
[Description("Wrapper class for the CEN-IO-IR-104 module")] [Description("Wrapper class for the CEN-IO-IR-104 module")]
public class CenIoIr104Controller : EssentialsDevice, IIROutputPorts public class CenIoIr104Controller : CrestronGenericBaseDevice, IIROutputPorts
{ {
private readonly CenIoIr104 _ir104; private readonly CenIoIr104 _ir104;
@@ -27,7 +27,7 @@ namespace PepperDash.Essentials.Core
/// <param name="name"></param> /// <param name="name"></param>
/// <param name="ir104"></param> /// <param name="ir104"></param>
public CenIoIr104Controller(string key, string name, CenIoIr104 ir104) public CenIoIr104Controller(string key, string name, CenIoIr104 ir104)
: base(key, name) : base(key, name, ir104)
{ {
_ir104 = ir104; _ir104 = ir104;
} }
@@ -78,7 +78,7 @@ namespace PepperDash.Essentials.Core
var control = CommFactory.GetControlPropertiesConfig(dc); var control = CommFactory.GetControlPropertiesConfig(dc);
if (control == null) if (control == null)
{ {
Debug.Console(1, "Factory failed to create a new CEN-IO-IR-104 Device"); Debug.Console(1, "Factory failed to create a new CEN-IO-IR-104 Device, control properties not found");
return null; return null;
} }

View File

@@ -10,7 +10,7 @@ namespace PepperDash.Essentials.Core
/// Wrapper class for CEN-IO-RY-104 relay module /// Wrapper class for CEN-IO-RY-104 relay module
/// </summary> /// </summary>
[Description("Wrapper class for the CEN-IO-RY-104 relay module")] [Description("Wrapper class for the CEN-IO-RY-104 relay module")]
public class CenIoRy104Controller : EssentialsDevice, IRelayPorts public class CenIoRy104Controller : CrestronGenericBaseDevice, IRelayPorts
{ {
private readonly CenIoRy104 _ry104; private readonly CenIoRy104 _ry104;
@@ -21,7 +21,7 @@ namespace PepperDash.Essentials.Core
/// <param name="name"></param> /// <param name="name"></param>
/// <param name="ry104"></param> /// <param name="ry104"></param>
public CenIoRy104Controller(string key, string name, CenIoRy104 ry104) public CenIoRy104Controller(string key, string name, CenIoRy104 ry104)
: base(key, name) : base(key, name, ry104)
{ {
_ry104 = ry104; _ry104 = ry104;
} }
@@ -63,7 +63,7 @@ namespace PepperDash.Essentials.Core
var controlPropertiesConfig = CommFactory.GetControlPropertiesConfig(dc); var controlPropertiesConfig = CommFactory.GetControlPropertiesConfig(dc);
if (controlPropertiesConfig == null) if (controlPropertiesConfig == null)
{ {
Debug.Console(1, "Factory failed to create a new CEN-IO-RY-104 Device"); Debug.Console(1, "Factory failed to create a new CEN-IO-RY-104 Device, control properties not found");
return null; return null;
} }