fix: updates mode for partition sensors when mode of room combiner changes

This commit is contained in:
Neil Dorin
2024-06-28 12:57:06 -06:00
parent c7f4bf1fb2
commit 71815eff17

View File

@@ -132,6 +132,8 @@ namespace PepperDash.Essentials.Core
void PartitionPresentFeedback_OutputChange(object sender, FeedbackEventArgs e) void PartitionPresentFeedback_OutputChange(object sender, FeedbackEventArgs e)
{ {
if (!IsInAutoMode) return;
StartDebounceTimer(); StartDebounceTimer();
} }
@@ -232,16 +234,33 @@ namespace PepperDash.Essentials.Core
public void SetAutoMode() public void SetAutoMode()
{ {
IsInAutoMode = true; IsInAutoMode = true;
foreach (var partition in Partitions)
{
partition.SetAutoMode();
}
} }
public void SetManualMode() public void SetManualMode()
{ {
IsInAutoMode = false; IsInAutoMode = false;
foreach (var partition in Partitions)
{
partition.SetManualMode();
}
} }
public void ToggleMode() public void ToggleMode()
{ {
IsInAutoMode = !IsInAutoMode; if(IsInAutoMode)
{
SetManualMode();
}
else
{
SetAutoMode();
}
} }
public List<IRoomCombinationScenario> RoomCombinationScenarios { get; private set; } public List<IRoomCombinationScenario> RoomCombinationScenarios { get; private set; }