diff --git a/src/PepperDash.Essentials.MobileControl/RoomBridges/MobileControlEssentialsRoomBridge.cs b/src/PepperDash.Essentials.MobileControl/RoomBridges/MobileControlEssentialsRoomBridge.cs index ac53a1d49..9009c4cc9 100644 --- a/src/PepperDash.Essentials.MobileControl/RoomBridges/MobileControlEssentialsRoomBridge.cs +++ b/src/PepperDash.Essentials.MobileControl/RoomBridges/MobileControlEssentialsRoomBridge.cs @@ -116,6 +116,45 @@ protected override void RegisterActions() if (Room is IRunDefaultPresentRoute defaultRoom) AddAction("/defaultsource", (id, content) => defaultRoom.RunDefaultPresentRoute()); + if (Room is IHasCurrentSourceInfoChange sscRoom) + sscRoom.CurrentSourceChange += Room_CurrentSingleSourceChange; + + if (Room is IEssentialsHuddleVtc1Room vtcRoom) + { + if (vtcRoom.ScheduleSource != null) + { + var key = vtcRoom.Key + "-" + Key; + + if (!AppServerController.CheckForDeviceMessenger(key)) + { + var scheduleMessenger = new IHasScheduleAwarenessMessenger(key, vtcRoom.ScheduleSource, + $"/room/{vtcRoom.Key}"); + AppServerController.AddDeviceMessenger(scheduleMessenger); + } + } + + vtcRoom.InCallFeedback.OutputChange += InCallFeedback_OutputChange; + } + + if (Room is IPrivacy privacyRoom) + { + AddAction("/volumes/master/privacyMuteToggle", (id, content) => privacyRoom.PrivacyModeToggle()); + + privacyRoom.PrivacyModeIsOnFeedback.OutputChange += PrivacyModeIsOnFeedback_OutputChange; + } + + + if (Room is IRunDefaultCallRoute defCallRm) + { + AddAction("/activityVideo", (id, content) => defCallRm.RunDefaultCallRoute()); + } + + Room.OnFeedback.OutputChange += OnFeedback_OutputChange; + Room.IsCoolingDownFeedback.OutputChange += IsCoolingDownFeedback_OutputChange; + Room.IsWarmingUpFeedback.OutputChange += IsWarmingUpFeedback_OutputChange; + + AddTechRoomActions(); + if (Room is IHasCurrentVolumeControls volumeRoom) { volumeRoom.CurrentVolumeDeviceChange += Room_CurrentVolumeDeviceChange; @@ -146,12 +185,12 @@ protected override void RegisterActions() }); AddAction("/volumes/master/volumeUp", (id, content) => PressAndHoldHandler.HandlePressAndHold(DeviceKey, content, (b) => + { + if (volumeRoom.CurrentVolumeControls is IBasicVolumeWithFeedback basicVolumeWithFeedback) { - if (volumeRoom.CurrentVolumeControls is IBasicVolumeWithFeedback basicVolumeWithFeedback) - { - basicVolumeWithFeedback.VolumeUp(b); - } + basicVolumeWithFeedback.VolumeUp(b); } + } )); AddAction("/volumes/master/volumeDown", (id, content) => PressAndHoldHandler.HandlePressAndHold(DeviceKey, content, (b) => @@ -163,7 +202,6 @@ protected override void RegisterActions() } )); - // Registers for initial volume events, if possible if (volumeRoom.CurrentVolumeControls is IBasicVolumeWithFeedback currentVolumeDevice) { @@ -173,45 +211,6 @@ protected override void RegisterActions() currentVolumeDevice.VolumeLevelFeedback.OutputChange += VolumeLevelFeedback_OutputChange; } } - - if (Room is IHasCurrentSourceInfoChange sscRoom) - sscRoom.CurrentSourceChange += Room_CurrentSingleSourceChange; - - if (Room is IEssentialsHuddleVtc1Room vtcRoom) - { - if (vtcRoom.ScheduleSource != null) - { - var key = vtcRoom.Key + "-" + Key; - - if (!AppServerController.CheckForDeviceMessenger(key)) - { - var scheduleMessenger = new IHasScheduleAwarenessMessenger(key, vtcRoom.ScheduleSource, - $"/room/{vtcRoom.Key}"); - AppServerController.AddDeviceMessenger(scheduleMessenger); - } - } - - vtcRoom.InCallFeedback.OutputChange += InCallFeedback_OutputChange; - } - - if (Room is IPrivacy privacyRoom) - { - AddAction("/volumes/master/privacyMuteToggle", (id, content) => privacyRoom.PrivacyModeToggle()); - - privacyRoom.PrivacyModeIsOnFeedback.OutputChange += PrivacyModeIsOnFeedback_OutputChange; - } - - - if (Room is IRunDefaultCallRoute defCallRm) - { - AddAction("/activityVideo", (id, content) => defCallRm.RunDefaultCallRoute()); - } - - Room.OnFeedback.OutputChange += OnFeedback_OutputChange; - Room.IsCoolingDownFeedback.OutputChange += IsCoolingDownFeedback_OutputChange; - Room.IsWarmingUpFeedback.OutputChange += IsWarmingUpFeedback_OutputChange; - - AddTechRoomActions(); } private void OnTouchPanelsUpdated(JToken content)