mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-12 12:06:58 +00:00
Added console command to print occupancy sensor settings in console.
This commit is contained in:
parent
5a2070de3f
commit
c6cfecdbbb
3 changed files with 1196 additions and 1074 deletions
|
|
@ -120,13 +120,13 @@ namespace PepperDash.Essentials.Core
|
|||
|
||||
OccSensor.CenOccupancySensorChange += new GenericEventHandler(OccSensor_CenOccupancySensorChange);
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(GetSettings,
|
||||
"occsensorstatus",
|
||||
"Reports current occupancy sensor settings. Requires a device key.",
|
||||
ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Catches events for feedbacks on the base class. Any extending wrapper class should call this delegate after it checks for it's own event IDs.
|
||||
/// </summary>
|
||||
|
|
@ -432,6 +432,47 @@ namespace PepperDash.Essentials.Core
|
|||
}
|
||||
}
|
||||
|
||||
private static void GetSettings(string key)
|
||||
{
|
||||
var dev = DeviceManager.GetDeviceForKey(key);
|
||||
if (dev == null) return;
|
||||
|
||||
var sensor = dev as CenOdtOccupancySensorBaseController;
|
||||
if (sensor == null) return;
|
||||
|
||||
if (!sensor.Hardware.IsOnline)
|
||||
{
|
||||
Debug.Console(0, sensor.Key, "Sensor IsOnline: {0}", sensor.Hardware.IsOnline);
|
||||
return;
|
||||
}
|
||||
|
||||
var dash = new string('*', 50);
|
||||
CrestronConsole.PrintLine(string.Format("{0}\n", dash));
|
||||
|
||||
Debug.Console(0, sensor.Key, "Timeout Current: {0} | Remote: {1}",
|
||||
sensor.CurrentTimeoutFeedback.UShortValue,
|
||||
sensor.RemoteTimeoutFeedback.UShortValue);
|
||||
|
||||
Debug.Console(0, sensor.Key, "Short Timeout Enabled: {0}",
|
||||
sensor.ShortTimeoutEnabledFeedback.BoolValue);
|
||||
|
||||
Debug.Console(0, sensor.Key, "PIR Sensor Enabled: {0} | Sensitivity Occupied: {1} | Sensitivity Vacant: {2}",
|
||||
sensor.PirSensorEnabledFeedback.BoolValue,
|
||||
sensor.PirSensitivityInOccupiedStateFeedback.UShortValue,
|
||||
sensor.PirSensitivityInVacantStateFeedback.UShortValue);
|
||||
|
||||
Debug.Console(0, sensor.Key, "Ultrasonic Enabled A: {0} | B: {1}",
|
||||
sensor.UltrasonicAEnabledFeedback.BoolValue,
|
||||
sensor.UltrasonicBEnabledFeedback.BoolValue);
|
||||
|
||||
Debug.Console(0, sensor.Key, "Ultrasonic Sensitivity Occupied: {0} | Vacant: {1}",
|
||||
sensor.UltrasonicSensitivityInOccupiedStateFeedback.UShortValue,
|
||||
sensor.UltrasonicSensitivityInVacantStateFeedback.UShortValue);
|
||||
|
||||
CrestronConsole.PrintLine(string.Format("{0}\n", dash));
|
||||
}
|
||||
|
||||
|
||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||
{
|
||||
LinkOccSensorToApi(this, trilist, joinStart, joinMapKey, bridge);
|
||||
|
|
|
|||
|
|
@ -70,6 +70,11 @@ namespace PepperDash.Essentials.Core
|
|||
RegisterGlsOdtSensorBaseController(OccSensor);
|
||||
|
||||
});
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(GetSettings,
|
||||
"occsensorstatus",
|
||||
"Reports current occupancy sensor settings. Requires a device key.",
|
||||
ConsoleAccessLevelEnum.AccessOperator);
|
||||
}
|
||||
|
||||
public GlsOccupancySensorBaseController(string key, string name) : base(key, name) { }
|
||||
|
|
@ -293,7 +298,37 @@ namespace PepperDash.Essentials.Core
|
|||
OccSensor.ExternalPhotoSensorMinimumChange.UShortValue = value;
|
||||
}
|
||||
|
||||
private static void GetSettings(string key)
|
||||
{
|
||||
var dev = DeviceManager.GetDeviceForKey(key);
|
||||
if (dev == null) return;
|
||||
|
||||
var sensor = dev as GlsOccupancySensorBaseController;
|
||||
if (sensor == null) return;
|
||||
|
||||
if (!sensor.Hardware.IsOnline)
|
||||
{
|
||||
Debug.Console(0, sensor.Key, "Sensor IsOnline: {0}", sensor.Hardware.IsOnline);
|
||||
return;
|
||||
}
|
||||
|
||||
var dash = new string('*', 50);
|
||||
CrestronConsole.PrintLine(string.Format("{0}\n", dash));
|
||||
|
||||
Debug.Console(0, sensor.Key, "Timeout Current: {0} | Local: {1}",
|
||||
sensor.CurrentTimeoutFeedback.UShortValue,
|
||||
sensor.LocalTimoutFeedback.UShortValue);
|
||||
|
||||
Debug.Console(0, sensor.Key, "Short Timeout Enabled: {0}",
|
||||
sensor.ShortTimeoutEnabledFeedback.BoolValue);
|
||||
|
||||
Debug.Console(0, sensor.Key, "PIR Sensor Enabled: {0} | Sensitivity Occupied: {1} | Sensitivity Vacant: {2}",
|
||||
sensor.PirSensorEnabledFeedback.BoolValue,
|
||||
sensor.PirSensitivityInOccupiedStateFeedback.UShortValue,
|
||||
sensor.PirSensitivityInVacantStateFeedback.UShortValue);
|
||||
|
||||
CrestronConsole.PrintLine(string.Format("{0}\n", dash));
|
||||
}
|
||||
|
||||
protected void LinkOccSensorToApi(GlsOccupancySensorBaseController occController, BasicTriList trilist,
|
||||
uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||
|
|
|
|||
|
|
@ -64,6 +64,11 @@ namespace PepperDash.Essentials.Core
|
|||
UltrasonicSensitivityInOccupiedStateFeedback = new IntFeedback(() => OccSensor.UsSensitivityInOccupiedStateFeedback.UShortValue);
|
||||
|
||||
});
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(GetSettings,
|
||||
"occsensorstatus",
|
||||
"Reports current occupancy sensor settings. Requires a device key.",
|
||||
ConsoleAccessLevelEnum.AccessOperator);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -170,6 +175,47 @@ namespace PepperDash.Essentials.Core
|
|||
LinkOccSensorToApi(this, trilist, joinStart, joinMapKey, bridge);
|
||||
}
|
||||
|
||||
private static void GetSettings(string key)
|
||||
{
|
||||
var dev = DeviceManager.GetDeviceForKey(key);
|
||||
if (dev == null) return;
|
||||
|
||||
var sensor = dev as GlsOdtOccupancySensorController;
|
||||
if (sensor == null) return;
|
||||
|
||||
if (!sensor.Hardware.IsOnline)
|
||||
{
|
||||
Debug.Console(0, sensor.Key, "Sensor IsOnline: {0}", sensor.Hardware.IsOnline);
|
||||
return;
|
||||
}
|
||||
|
||||
var dash = new string('*', 50);
|
||||
CrestronConsole.PrintLine(string.Format("{0}\n", dash));
|
||||
|
||||
Debug.Console(0, sensor.Key, "Timeout Current: {0} | Local: {1}",
|
||||
sensor.CurrentTimeoutFeedback.UShortValue,
|
||||
sensor.LocalTimoutFeedback.UShortValue);
|
||||
|
||||
Debug.Console(0, sensor.Key, "Short Timeout Enabled: {0}",
|
||||
sensor.ShortTimeoutEnabledFeedback.BoolValue);
|
||||
|
||||
Debug.Console(0, sensor.Key, "PIR Sensor Enabled: {0} | Sensitivity Occupied: {1} | Sensitivity Vacant: {2}",
|
||||
sensor.PirSensorEnabledFeedback.BoolValue,
|
||||
sensor.PirSensitivityInOccupiedStateFeedback.UShortValue,
|
||||
sensor.PirSensitivityInVacantStateFeedback.UShortValue);
|
||||
|
||||
Debug.Console(0, sensor.Key, "Ultrasonic Enabled A: {0} | B: {1}",
|
||||
sensor.UltrasonicAEnabledFeedback.BoolValue,
|
||||
sensor.UltrasonicBEnabledFeedback.BoolValue);
|
||||
|
||||
Debug.Console(0, sensor.Key, "Ultrasonic Sensitivity Occupied: {0} | Vacant: {1}",
|
||||
sensor.UltrasonicSensitivityInOccupiedStateFeedback.UShortValue,
|
||||
sensor.UltrasonicSensitivityInVacantStateFeedback.UShortValue);
|
||||
|
||||
CrestronConsole.PrintLine(string.Format("{0}\n", dash));
|
||||
}
|
||||
|
||||
|
||||
#region PreActivation
|
||||
|
||||
private static GlsOdtCCn GetGlsOdtCCn(DeviceConfig dc)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue