From 085ba134c46109b8d737008d5976f13a2a28397c Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Thu, 18 Mar 2021 12:44:20 -0600 Subject: [PATCH] Set event to not be acknowledgable Added logic to acknowledge event Added debug statement to show that event was being fired --- .../Behaviours/RoomOnToDefaultSourceWhenOccupied.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Room/Behaviours/RoomOnToDefaultSourceWhenOccupied.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Room/Behaviours/RoomOnToDefaultSourceWhenOccupied.cs index 11debb03..f24daf82 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Room/Behaviours/RoomOnToDefaultSourceWhenOccupied.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Room/Behaviours/RoomOnToDefaultSourceWhenOccupied.cs @@ -169,10 +169,15 @@ namespace PepperDash.Essentials.Core 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) { + SchEvent.Acknowledge(); + if (SchEvent.Name == FeatureEnableEventName) { + if (PropertiesConfig.EnableRoomOnWhenOccupied) FeatureEnabled = true; @@ -248,9 +253,8 @@ namespace PepperDash.Essentials.Core schEvent = new ScheduledEvent(name, FeatureEventGroup); // Set up its initial properties - - if(!schEvent.Acknowledgeable) - schEvent.Acknowledgeable = true; + + schEvent.Acknowledgeable = false; if(!schEvent.Persistent) 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()); - CalculateAndSetAcknowledgeExpirationTimeout(schEvent, FeatureEnabledTime, FeatureDisabledTime); + //CalculateAndSetAcknowledgeExpirationTimeout(schEvent, FeatureEnabledTime, FeatureDisabledTime); schEvent.Recurrence.Weekly(eventRecurrennce);