mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 20:54:55 +00:00
Moves feebdack FireUpdates to correct event handler callback delegate
This commit is contained in:
@@ -103,6 +103,18 @@ namespace PepperDash.Essentials.Devices.Common.Occupancy
|
|||||||
PirSensitivityInOccupiedStateFeedback.FireUpdate();
|
PirSensitivityInOccupiedStateFeedback.FireUpdate();
|
||||||
else if (args.EventId == GlsOccupancySensorBase.PirSensitivityInVacantStateFeedbackEventId)
|
else if (args.EventId == GlsOccupancySensorBase.PirSensitivityInVacantStateFeedbackEventId)
|
||||||
PirSensitivityInVacantStateFeedback.FireUpdate();
|
PirSensitivityInVacantStateFeedback.FireUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual void OccSensor_BaseEvent(Crestron.SimplSharpPro.GenericBase device, Crestron.SimplSharpPro.BaseEventArgs args)
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "GlsOccupancySensorChange EventId: {0}", args.EventId);
|
||||||
|
|
||||||
|
if (args.EventId == Crestron.SimplSharpPro.GeneralIO.GlsOccupancySensorBase.RoomOccupiedFeedbackEventId
|
||||||
|
|| args.EventId == Crestron.SimplSharpPro.GeneralIO.GlsOccupancySensorBase.RoomVacantFeedbackEventId)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Occupancy State: {0}", OccSensor.OccupancyDetectedFeedback.BoolValue);
|
||||||
|
RoomIsOccupiedFeedback.FireUpdate();
|
||||||
|
}
|
||||||
else if (args.EventId == GlsOccupancySensorBase.TimeoutFeedbackEventId)
|
else if (args.EventId == GlsOccupancySensorBase.TimeoutFeedbackEventId)
|
||||||
CurrentTimeoutFeedback.FireUpdate();
|
CurrentTimeoutFeedback.FireUpdate();
|
||||||
else if (args.EventId == GlsOccupancySensorBase.TimeoutLocalFeedbackEventId)
|
else if (args.EventId == GlsOccupancySensorBase.TimeoutLocalFeedbackEventId)
|
||||||
@@ -117,18 +129,6 @@ namespace PepperDash.Essentials.Devices.Common.Occupancy
|
|||||||
ExternalPhotoSensorValue.FireUpdate();
|
ExternalPhotoSensorValue.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OccSensor_BaseEvent(Crestron.SimplSharpPro.GenericBase device, Crestron.SimplSharpPro.BaseEventArgs args)
|
|
||||||
{
|
|
||||||
Debug.Console(2, this, "GlsOccupancySensorChange EventId: {0}", args.EventId);
|
|
||||||
|
|
||||||
if (args.EventId == Crestron.SimplSharpPro.GeneralIO.GlsOccupancySensorBase.RoomOccupiedFeedbackEventId
|
|
||||||
|| args.EventId == Crestron.SimplSharpPro.GeneralIO.GlsOccupancySensorBase.RoomVacantFeedbackEventId)
|
|
||||||
{
|
|
||||||
Debug.Console(1, this, "Occupancy State: {0}", OccSensor.OccupancyDetectedFeedback.BoolValue);
|
|
||||||
RoomIsOccupiedFeedback.FireUpdate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SetTestMode(bool mode)
|
public void SetTestMode(bool mode)
|
||||||
{
|
{
|
||||||
InTestMode = mode;
|
InTestMode = mode;
|
||||||
|
|||||||
@@ -69,28 +69,30 @@ namespace PepperDash.Essentials.Devices.Common.Occupancy
|
|||||||
UltrasonicAEnabledFeedback.FireUpdate();
|
UltrasonicAEnabledFeedback.FireUpdate();
|
||||||
else if (args.EventId == GlsOccupancySensorBase.UsBEnabledFeedbackEventId)
|
else if (args.EventId == GlsOccupancySensorBase.UsBEnabledFeedbackEventId)
|
||||||
UltrasonicBEnabledFeedback.FireUpdate();
|
UltrasonicBEnabledFeedback.FireUpdate();
|
||||||
else if (args.EventId == GlsOccupancySensorBase.RawOccupancyPirFeedbackEventId)
|
|
||||||
RawOccupancyPirFeedback.FireUpdate();
|
|
||||||
else if (args.EventId == GlsOccupancySensorBase.RawOccupancyUsFeedbackEventId)
|
|
||||||
RawOccupancyUsFeedback.FireUpdate();
|
|
||||||
else if (args.EventId == GlsOccupancySensorBase.UsSensitivityInOccupiedStateFeedbackEventId)
|
else if (args.EventId == GlsOccupancySensorBase.UsSensitivityInOccupiedStateFeedbackEventId)
|
||||||
UltrasonicSensitivityInOccupiedStateFeedback.FireUpdate();
|
UltrasonicSensitivityInOccupiedStateFeedback.FireUpdate();
|
||||||
else if (args.EventId == GlsOccupancySensorBase.UsSensitivityInVacantStateFeedbackEventId)
|
else if (args.EventId == GlsOccupancySensorBase.UsSensitivityInVacantStateFeedbackEventId)
|
||||||
UltrasonicSensitivityInVacantStateFeedback.FireUpdate();
|
UltrasonicSensitivityInVacantStateFeedback.FireUpdate();
|
||||||
else if (args.EventId == GlsOccupancySensorBase.RawOccupancyPirFeedbackEventId)
|
|
||||||
{
|
|
||||||
Debug.Console(2, this, "Occsensor has had Raw PIR");
|
|
||||||
RawOccupancyPirFeedback.FireUpdate();
|
|
||||||
}
|
|
||||||
else if (args.EventId == GlsOccupancySensorBase.RawOccupancyUsFeedbackEventId)
|
|
||||||
{
|
|
||||||
Debug.Console(2, this, "Occsensor has had Raw US");
|
|
||||||
RawOccupancyUsFeedback.FireUpdate();
|
|
||||||
}
|
|
||||||
|
|
||||||
base.OccSensor_GlsOccupancySensorChange(device, args);
|
base.OccSensor_GlsOccupancySensorChange(device, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Overrides the base class event delegate to fire feedbacks for event IDs that pertain to this extended class.
|
||||||
|
/// Then calls the base delegate method to ensure any common event IDs are captured.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="device"></param>
|
||||||
|
/// <param name="args"></param>
|
||||||
|
protected override void OccSensor_BaseEvent(Crestron.SimplSharpPro.GenericBase device, Crestron.SimplSharpPro.BaseEventArgs args)
|
||||||
|
{
|
||||||
|
if (args.EventId == GlsOccupancySensorBase.RawOccupancyPirFeedbackEventId)
|
||||||
|
RawOccupancyPirFeedback.FireUpdate();
|
||||||
|
else if (args.EventId == GlsOccupancySensorBase.RawOccupancyUsFeedbackEventId)
|
||||||
|
RawOccupancyUsFeedback.FireUpdate();
|
||||||
|
|
||||||
|
base.OccSensor_BaseEvent(device, args);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets the OrWhenVacated state
|
/// Sets the OrWhenVacated state
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user