v1.0.33.* -Fixed issues with versiport configuration for pull up resistor based on feedback from Alex onsite. Corrected issue with RoomIsOccupiedFeedback_OutputChange method in EssentialsRoomBase. Updated Fusion Remote Occ sensor logic.

This commit is contained in:
Neil Dorin
2018-01-22 16:37:27 -07:00
parent b83b3737e9
commit b85abe1b79
10 changed files with 81 additions and 43 deletions

View File

@@ -177,28 +177,10 @@ namespace PepperDash.Essentials.Devices.Common
return null;
}
if (cs.SupportsDigitalInput)
if (cs.SupportsVersiport)
{
if (props.PortNumber > cs.NumberOfDigitalInputPorts)
{
Debug.Console(0, "WARNING: Cannot register DIO port {0} on {1}. Out of range",
props.PortNumber, props.PortDeviceKey);
return null;
}
Debug.Console(1, "Attempting to add Digital Input device to Versiport port '{0}'", props.PortNumber);
DigitalInput digitalInput = cs.DigitalInputPorts[props.PortNumber];
if (!digitalInput.Registered)
{
if (digitalInput.Register() == eDeviceRegistrationUnRegistrationResponse.Success)
return new GenericDigitalInputDevice(key, digitalInput);
else
Debug.Console(0, "WARNING: Attempt to register digital input {0} on device with key '{1}' failed.",
props.PortNumber, props.PortDeviceKey);
}
}
else if (cs.SupportsVersiport)
{
if (props.PortNumber > cs.NumberOfVersiPorts)
{
Debug.Console(0, "WARNING: Cannot add Vesiport {0} on {1}. Out of range",
@@ -212,10 +194,9 @@ namespace PepperDash.Essentials.Devices.Common
{
var regSuccess = vp.Register();
if (regSuccess == eDeviceRegistrationUnRegistrationResponse.Success)
{
if (props.DisablePullUpResistor)
vp.DisablePullUpResistor = true;
return new GenericVersiportDigitalInputDevice(key, vp);
{
Debug.Console(1, "Successfully Created Digital Input Device on Versiport");
return new GenericVersiportDigitalInputDevice(key, vp, props);
}
else
{
@@ -225,6 +206,31 @@ namespace PepperDash.Essentials.Devices.Common
}
}
}
else if (cs.SupportsDigitalInput)
{
Debug.Console(1, "Attempting to add Digital Input device to Digital Input port '{0}'", props.PortNumber);
if (props.PortNumber > cs.NumberOfDigitalInputPorts)
{
Debug.Console(0, "WARNING: Cannot register DIO port {0} on {1}. Out of range",
props.PortNumber, props.PortDeviceKey);
return null;
}
DigitalInput digitalInput = cs.DigitalInputPorts[props.PortNumber];
if (!digitalInput.Registered)
{
if (digitalInput.Register() == eDeviceRegistrationUnRegistrationResponse.Success)
{
Debug.Console(1, "Successfully Created Digital Input Device on Digital Input");
return new GenericDigitalInputDevice(key, digitalInput);
}
else
Debug.Console(0, "WARNING: Attempt to register digital input {0} on device with key '{1}' failed.",
props.PortNumber, props.PortDeviceKey);
}
}
}
}

View File

@@ -50,7 +50,7 @@ namespace PepperDash.Essentials.Devices.Common.Occupancy
Debug.Console(1, this, "In Mock Mode: '{0}'", InTestMode);
}
public void SetTestState(bool state)
public void SetTestOccupiedState(bool state)
{
if (!InTestMode)
Debug.Console(1, "Mock mode not enabled");