From 9a818f81a8363299b33b084c756763338bc71176 Mon Sep 17 00:00:00 2001 From: equinoy Date: Thu, 21 May 2026 17:55:36 -0500 Subject: [PATCH] Add manual mode guard to prevent partition sensor changes in manual mode - Add guard clause in DetermineRoomCombinationScenario() to block ChangeScenario() when IsInAutoMode=false - Add RoomCombinationScenarioChanged event invocation to SetRoomCombinationScenario() so manual scenario changes notify subscribers - Ensures partition sensor events don't trigger automatic scenario changes in manual mode - Allows UI/API scenario changes to still fire notification events for messenger updates --- .../Room/Combining/EssentialsRoomCombiner.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/PepperDash.Essentials.Core/Room/Combining/EssentialsRoomCombiner.cs b/src/PepperDash.Essentials.Core/Room/Combining/EssentialsRoomCombiner.cs index 419df3fc..3f6a29c4 100644 --- a/src/PepperDash.Essentials.Core/Room/Combining/EssentialsRoomCombiner.cs +++ b/src/PepperDash.Essentials.Core/Room/Combining/EssentialsRoomCombiner.cs @@ -262,6 +262,11 @@ namespace PepperDash.Essentials.Core if (currentScenario != null) { this.LogInformation("Found combination Scenario {scenarioKey}", currentScenario.Key); + if (!IsInAutoMode) + { + this.LogDebug("ROOM_COMBINER_PARTITION_EVENT_IGNORED IsInAutoMode=false manual mode prevents sensor-driven scenario changes"); + return; + } ChangeScenario(currentScenario); } } @@ -459,6 +464,10 @@ namespace PepperDash.Essentials.Core Debug.LogMessage(LogEventLevel.Debug, this, "Unable to find partition with key: '{0}'", partitionState.PartitionKey); } } + + // Update _currentScenario and fire event to notify subscribers + _currentScenario = scenario; + RoomCombinationScenarioChanged?.Invoke(this, new EventArgs()); } else {