mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-07-02 02:28:19 +00:00
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
This commit is contained in:
parent
cbf92408c8
commit
9a818f81a8
1 changed files with 9 additions and 0 deletions
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue