Adds LinkToApi method and cleans up a couple of methods

This commit is contained in:
Andrew Welker
2020-04-14 16:14:25 -06:00
parent 2f17734a4c
commit 894a6a70bb

View File

@@ -3,10 +3,12 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.GeneralIO;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges;
namespace PepperDash.Essentials.Devices.Common.Occupancy
{
@@ -117,16 +119,8 @@ namespace PepperDash.Essentials.Devices.Common.Occupancy
/// <param name="state"></param>
public void SetUsAEnable(bool state)
{
if (state)
{
OccSensor.EnableUsA.BoolValue = state;
OccSensor.DisableUsA.BoolValue = !state;
}
else
{
OccSensor.EnableUsA.BoolValue = state;
OccSensor.DisableUsA.BoolValue = !state;
}
OccSensor.EnableUsA.BoolValue = state;
OccSensor.DisableUsA.BoolValue = !state;
}
@@ -136,16 +130,8 @@ namespace PepperDash.Essentials.Devices.Common.Occupancy
/// <param name="state"></param>
public void SetUsBEnable(bool state)
{
if (state)
{
OccSensor.EnableUsB.BoolValue = state;
OccSensor.DisableUsB.BoolValue = !state;
}
else
{
OccSensor.EnableUsB.BoolValue = state;
OccSensor.DisableUsB.BoolValue = !state;
}
OccSensor.EnableUsB.BoolValue = state;
OccSensor.DisableUsB.BoolValue = !state;
}
public void IncrementUsSensitivityInOccupiedState(bool pressRelease)
@@ -167,5 +153,10 @@ namespace PepperDash.Essentials.Devices.Common.Occupancy
{
OccSensor.DecrementUsSensitivityInVacantState.BoolValue = pressRelease;
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApi bridge)
{
LinkOccSensorToApi(this, trilist, joinStart, joinMapKey, bridge);
}
}
}