mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-07-02 10:38:16 +00:00
feat: implement manual mode guard to prevent automatic scenario changes from partition sensors
This commit is contained in:
parent
d0ab42ccb7
commit
cbf92408c8
1 changed files with 12 additions and 0 deletions
|
|
@ -185,12 +185,15 @@ namespace PepperDash.Essentials.Core
|
|||
|
||||
partition.PartitionPresentFeedback.OutputChange += PartitionPresentFeedback_OutputChange;
|
||||
|
||||
this.LogDebug("ROOM_COMBINER_PARTITION_SETUP partition='{0}' defaultToManualMode={1} IsInAutoMode={2}", pConfig.Key, _propertiesConfig.defaultToManualMode, IsInAutoMode);
|
||||
|
||||
Partitions.Add(partition);
|
||||
}
|
||||
}
|
||||
|
||||
private void PartitionPresentFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
||||
{
|
||||
this.LogDebug("ROOM_COMBINER_PARTITION_SENSOR_FIRED IsInAutoMode={0} — triggering debounce timer", IsInAutoMode);
|
||||
StartDebounceTimer();
|
||||
}
|
||||
|
||||
|
|
@ -217,6 +220,15 @@ namespace PepperDash.Essentials.Core
|
|||
/// </summary>
|
||||
private void DetermineRoomCombinationScenario()
|
||||
{
|
||||
// RACE CONDITION FIX: Don't determine scenario from partition sensors if in manual mode
|
||||
// Partition sensor events should not override defaultToManualMode: true setting
|
||||
// This prevents automatic scenario changes when user has explicitly set manual mode
|
||||
if (!IsInAutoMode)
|
||||
{
|
||||
this.LogDebug("ROOM_COMBINER_PARTITION_EVENT_IGNORED IsInAutoMode=false — manual mode prevents sensor-driven scenario changes");
|
||||
return;
|
||||
}
|
||||
|
||||
if (_scenarioChangeDebounceTimer != null)
|
||||
{
|
||||
_scenarioChangeDebounceTimer.Dispose();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue