mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 13:15:03 +00:00
feat: Added configuration for US and PIR sensitivity values from configuration. Add public method to set identity mode on/off for debugging and identifying remotely.
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Resources;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
@@ -199,6 +200,27 @@ namespace PepperDash.Essentials.Core
|
|||||||
{
|
{
|
||||||
SetAndWhenVacatedState((bool)PropertiesConfig.AndWhenVacatedState);
|
SetAndWhenVacatedState((bool)PropertiesConfig.AndWhenVacatedState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO [ ] feature/cenoodtcpoe-sensor-sensitivity-configuration
|
||||||
|
if (PropertiesConfig.UsSensitivityOccupied != null)
|
||||||
|
{
|
||||||
|
SetUsSensitivityOccupied((ushort)PropertiesConfig.UsSensitivityOccupied);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (PropertiesConfig.UsSensitivityVacant != null)
|
||||||
|
{
|
||||||
|
SetUsSensitivityVacant((ushort)PropertiesConfig.UsSensitivityVacant);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (PropertiesConfig.PirSensitivityOccupied != null)
|
||||||
|
{
|
||||||
|
SetPirSensitivityOccupied((ushort)PropertiesConfig.PirSensitivityOccupied);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (PropertiesConfig.PirSensitivityVacant != null)
|
||||||
|
{
|
||||||
|
SetPirSensitivityVacant((ushort)PropertiesConfig.PirSensitivityVacant);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -279,7 +301,21 @@ namespace PepperDash.Essentials.Core
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// Sets the identity mode on or off
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="state"></param>
|
||||||
|
public void SetIdentityMode(bool state)
|
||||||
|
{
|
||||||
|
if (state)
|
||||||
|
OccSensor.IdentityModeOn();
|
||||||
|
else
|
||||||
|
OccSensor.IdentityModeOff();
|
||||||
|
|
||||||
|
Debug.Console(1, this, "Identity Mode: {0}", OccSensor.IdentityModeOnFeedback.BoolValue ? "On" : "Off");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
/// Enables or disables the PIR sensor
|
/// Enables or disables the PIR sensor
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="state"></param>
|
/// <param name="state"></param>
|
||||||
@@ -506,6 +542,54 @@ namespace PepperDash.Essentials.Core
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the US sensor sensitivity for occupied state
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sensitivity"></param>
|
||||||
|
public void SetUsSensitivityOccupied(ushort sensitivity)
|
||||||
|
{
|
||||||
|
var level = (eSensitivityLevel) sensitivity;
|
||||||
|
if (level == 0) return;
|
||||||
|
|
||||||
|
OccSensor.UltrasonicSensorSensitivityInOccupiedState = level;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the US sensor sensitivity for vacant state
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sensitivity"></param>
|
||||||
|
public void SetUsSensitivityVacant(ushort sensitivity)
|
||||||
|
{
|
||||||
|
var level = (eSensitivityLevel)sensitivity;
|
||||||
|
if (level == 0) return;
|
||||||
|
|
||||||
|
OccSensor.UltrasonicSensorSensitivityInVacantState = level;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the PIR sensor sensitivity for occupied state
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sensitivity"></param>
|
||||||
|
public void SetPirSensitivityOccupied(ushort sensitivity)
|
||||||
|
{
|
||||||
|
var level = (eSensitivityLevel)sensitivity;
|
||||||
|
if (level == 0) return;
|
||||||
|
|
||||||
|
OccSensor.PassiveInfraredSensorSensitivityInOccupiedState = level;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the PIR sensor sensitivity for vacant state
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sensitivity"></param>
|
||||||
|
public void SetPirSensitivityVacant(ushort sensitivity)
|
||||||
|
{
|
||||||
|
var level = (eSensitivityLevel)sensitivity;
|
||||||
|
if (level == 0) return;
|
||||||
|
|
||||||
|
OccSensor.PassiveInfraredSensorSensitivityInVacantState = level;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Method to print current settings to console
|
/// Method to print current settings to console
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -647,8 +731,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
//Sensor Raw States
|
//Sensor Raw States
|
||||||
occController.RawOccupancyPirFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyPirFeedback.JoinNumber]);
|
occController.RawOccupancyPirFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyPirFeedback.JoinNumber]);
|
||||||
occController.RawOccupancyUsFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyUsFeedback.JoinNumber]);
|
occController.RawOccupancyUsFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyUsFeedback.JoinNumber]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CenOdtOccupancySensorBaseControllerFactory : EssentialsDeviceFactory<CenOdtOccupancySensorBaseController>
|
public class CenOdtOccupancySensorBaseControllerFactory : EssentialsDeviceFactory<CenOdtOccupancySensorBaseController>
|
||||||
|
|||||||
Reference in New Issue
Block a user