From d63787bc783482164be5fd0857b5673a5b5c3b7a Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Mon, 13 Jan 2020 21:54:12 -0700 Subject: [PATCH] Adds logging for room on/off and occupancy events --- .../Room/Types/EssentialsHuddleSpaceRoom.cs | 6 ++++-- .../Room/Types/EssentialsHuddleVtc1Room.cs | 7 ++++++- .../PepperDashEssentialsBase/Room/EssentialsRoomBase.cs | 9 +++++---- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/PepperDashEssentials/Room/Types/EssentialsHuddleSpaceRoom.cs b/PepperDashEssentials/Room/Types/EssentialsHuddleSpaceRoom.cs index e4b503c3..9bec05b8 100644 --- a/PepperDashEssentials/Room/Types/EssentialsHuddleSpaceRoom.cs +++ b/PepperDashEssentials/Room/Types/EssentialsHuddleSpaceRoom.cs @@ -223,6 +223,8 @@ namespace PepperDash.Essentials CrestronEnvironment.Sleep(1000); + Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Shutting down room"); + RunRouteAction("roomOff"); } @@ -275,8 +277,8 @@ namespace PepperDash.Essentials // Run this on a separate thread new CTimer(o => { - Debug.Console(1, this, "Run route action '{0}'", routeKey); - var dict = ConfigReader.ConfigObject.GetSourceListForKey(SourceListKey); + Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Run route action '{0}'", routeKey); + var dict = ConfigReader.ConfigObject.GetSourceListForKey(SourceListKey); if(dict == null) { Debug.Console(1, this, "WARNING: Config source list '{0}' not found", SourceListKey); diff --git a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs b/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs index 62fbe754..b2db56ae 100644 --- a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs +++ b/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs @@ -334,8 +334,11 @@ namespace PepperDash.Essentials { // Add Occupancy object from config if (PropertiesConfig.Occupancy != null) + { + Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Setting Occupancy Provider for room"); this.SetRoomOccupancy(DeviceManager.GetDeviceForKey(PropertiesConfig.Occupancy.DeviceKey) as IOccupancyStatusProvider, PropertiesConfig.Occupancy.TimeoutMinutes); + } this.LogoUrl = PropertiesConfig.Logo.GetUrl(); this.SourceListKey = PropertiesConfig.SourceListKey; @@ -359,6 +362,8 @@ namespace PepperDash.Essentials CrestronEnvironment.Sleep(1000); + Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Shutting down room"); + RunRouteAction("roomOff"); } @@ -408,7 +413,7 @@ namespace PepperDash.Essentials try { - Debug.Console(1, this, "Run route action '{0}'", routeKey); + Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Run route action '{0}'", routeKey); var dict = ConfigReader.ConfigObject.GetSourceListForKey(SourceListKey); if (dict == null) { diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Room/EssentialsRoomBase.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Room/EssentialsRoomBase.cs index a7357f3f..7781f468 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Room/EssentialsRoomBase.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Room/EssentialsRoomBase.cs @@ -164,7 +164,7 @@ namespace PepperDash.Essentials.Core ShutdownType = type; ShutdownPromptTimer.Start(); - Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "ShutdwonPromptTimer Started. Type: {0}. Seconds: {1}", ShutdownType, ShutdownPromptTimer.SecondsToCount); + Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "ShutdownPromptTimer Started. Type: {0}. Seconds: {1}", ShutdownType, ShutdownPromptTimer.SecondsToCount); } public void StartRoomVacancyTimer(eVacancyMode mode) @@ -212,6 +212,9 @@ namespace PepperDash.Essentials.Core return; } + Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Room Occupancy set to device: '{0}'", (statusProvider as Device).Key); + Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Timeout Minutes from Config is: {0}", timeoutMinutes); + // If status provider is fusion, set flag to remote if (statusProvider is Core.Fusion.EssentialsHuddleSpaceFusionSystemControllerBase) OccupancyStatusProviderIsRemote = true; @@ -223,12 +226,10 @@ namespace PepperDash.Essentials.Core RoomOccupancy = statusProvider; - OnRoomOccupancyIsSet(); - RoomOccupancy.RoomIsOccupiedFeedback.OutputChange -= RoomIsOccupiedFeedback_OutputChange; RoomOccupancy.RoomIsOccupiedFeedback.OutputChange += RoomIsOccupiedFeedback_OutputChange; - Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Room Occupancy set to device: '{0}'", (statusProvider as Device).Key); + OnRoomOccupancyIsSet(); } void OnRoomOccupancyIsSet()