Set event to not be acknowledgable

Added logic to acknowledge event
Added debug statement to show that event was being fired
This commit is contained in:
Andrew Welker
2021-03-18 12:44:20 -06:00
parent a9fce3237c
commit 085ba134c4

View File

@@ -169,10 +169,15 @@ namespace PepperDash.Essentials.Core
void FeatureEventGroup_UserGroupCallBack(ScheduledEvent SchEvent, ScheduledEventCommon.eCallbackReason type) void FeatureEventGroup_UserGroupCallBack(ScheduledEvent SchEvent, ScheduledEventCommon.eCallbackReason type)
{ {
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "{0}:{1} @ {2}", SchEvent.Name, type, DateTime.Now);
if (type == ScheduledEventCommon.eCallbackReason.NormalExpiration) if (type == ScheduledEventCommon.eCallbackReason.NormalExpiration)
{ {
SchEvent.Acknowledge();
if (SchEvent.Name == FeatureEnableEventName) if (SchEvent.Name == FeatureEnableEventName)
{ {
if (PropertiesConfig.EnableRoomOnWhenOccupied) if (PropertiesConfig.EnableRoomOnWhenOccupied)
FeatureEnabled = true; FeatureEnabled = true;
@@ -249,8 +254,7 @@ namespace PepperDash.Essentials.Core
// Set up its initial properties // Set up its initial properties
if(!schEvent.Acknowledgeable) schEvent.Acknowledgeable = false;
schEvent.Acknowledgeable = true;
if(!schEvent.Persistent) if(!schEvent.Persistent)
schEvent.Persistent = true; schEvent.Persistent = true;
@@ -287,7 +291,7 @@ namespace PepperDash.Essentials.Core
Debug.Console(1, this, "Event '{0}' Absolute time set to {1}", schEvent.Name, schEvent.DateAndTime.ToString()); Debug.Console(1, this, "Event '{0}' Absolute time set to {1}", schEvent.Name, schEvent.DateAndTime.ToString());
CalculateAndSetAcknowledgeExpirationTimeout(schEvent, FeatureEnabledTime, FeatureDisabledTime); //CalculateAndSetAcknowledgeExpirationTimeout(schEvent, FeatureEnabledTime, FeatureDisabledTime);
schEvent.Recurrence.Weekly(eventRecurrennce); schEvent.Recurrence.Weekly(eventRecurrennce);