mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-03 14:55:05 +00:00
fix: change source for PartitionPresent depending on mode
Added `FireUpdate` calls for feedback on mode change in order to get correct values when changing modes.
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
using System;
|
||||
using PepperDash.Core;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
@@ -26,6 +22,11 @@ namespace PepperDash.Essentials.Core
|
||||
{
|
||||
get
|
||||
{
|
||||
if (IsInAutoMode)
|
||||
{
|
||||
return _partitionSensor.PartitionPresentFeedback.BoolValue;
|
||||
}
|
||||
|
||||
return _partitionPresent;
|
||||
}
|
||||
set
|
||||
@@ -73,18 +74,11 @@ namespace PepperDash.Essentials.Core
|
||||
PartitionPresentFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
void PartitionPresentFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
||||
private void PartitionPresentFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
||||
{
|
||||
if (IsInAutoMode)
|
||||
{
|
||||
if(e.BoolValue)
|
||||
{
|
||||
PartitionPresent = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
PartitionPresent = false;
|
||||
}
|
||||
PartitionPresent = e.BoolValue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,6 +105,8 @@ namespace PepperDash.Essentials.Core
|
||||
_partitionSensor.PartitionPresentFeedback.OutputChange -= PartitionPresentFeedback_OutputChange;
|
||||
_partitionSensor.PartitionPresentFeedback.OutputChange += PartitionPresentFeedback_OutputChange;
|
||||
}
|
||||
|
||||
PartitionPresentFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
public void SetManualMode()
|
||||
@@ -131,6 +127,8 @@ namespace PepperDash.Essentials.Core
|
||||
{
|
||||
_partitionSensor.PartitionPresentFeedback.OutputChange -= PartitionPresentFeedback_OutputChange;
|
||||
}
|
||||
|
||||
PartitionPresentFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user