mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 12:44:58 +00:00
feat: updates to Room combiner for use with mobile control
This commit is contained in:
@@ -19,7 +19,29 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
private bool isInAutoMode;
|
private bool isInAutoMode;
|
||||||
|
|
||||||
private bool partitionPresent;
|
private bool _partitionPresent;
|
||||||
|
|
||||||
|
public bool PartitionPresent
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _partitionPresent;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_partitionPresent == value)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_partitionPresent = value;
|
||||||
|
|
||||||
|
if (PartitionPresentFeedback != null)
|
||||||
|
{
|
||||||
|
PartitionPresentFeedback.FireUpdate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public EssentialsPartitionController(string key, string name, IPartitionStateProvider sensor, bool defaultToManualMode, List<string> adjacentRoomKeys)
|
public EssentialsPartitionController(string key, string name, IPartitionStateProvider sensor, bool defaultToManualMode, List<string> adjacentRoomKeys)
|
||||||
{
|
{
|
||||||
@@ -85,11 +107,11 @@ namespace PepperDash.Essentials.Core
|
|||||||
isInAutoMode = false;
|
isInAutoMode = false;
|
||||||
if (PartitionPresentFeedback != null)
|
if (PartitionPresentFeedback != null)
|
||||||
{
|
{
|
||||||
PartitionPresentFeedback.SetValueFunc(() => partitionPresent);
|
PartitionPresentFeedback.SetValueFunc(() => _partitionPresent);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PartitionPresentFeedback = new BoolFeedback(() => partitionPresent);
|
PartitionPresentFeedback = new BoolFeedback(() => _partitionPresent);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_partitionSensor != null)
|
if (_partitionSensor != null)
|
||||||
@@ -103,7 +125,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
{
|
{
|
||||||
if (!isInAutoMode)
|
if (!isInAutoMode)
|
||||||
{
|
{
|
||||||
partitionPresent = true;
|
PartitionPresent = true;
|
||||||
PartitionPresentFeedback.FireUpdate();
|
PartitionPresentFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -112,7 +134,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
{
|
{
|
||||||
if (!isInAutoMode)
|
if (!isInAutoMode)
|
||||||
{
|
{
|
||||||
partitionPresent = false;
|
PartitionPresent = false;
|
||||||
PartitionPresentFeedback.FireUpdate();
|
PartitionPresentFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -121,7 +143,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
{
|
{
|
||||||
if (!isInAutoMode)
|
if (!isInAutoMode)
|
||||||
{
|
{
|
||||||
partitionPresent = !partitionPresent;
|
PartitionPresent = !PartitionPresent;
|
||||||
PartitionPresentFeedback.FireUpdate();
|
PartitionPresentFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
using Newtonsoft.Json;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using Crestron.SimplSharp;
|
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core
|
namespace PepperDash.Essentials.Core
|
||||||
@@ -13,7 +9,11 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IPartitionStateProvider : IKeyName
|
public interface IPartitionStateProvider : IKeyName
|
||||||
{
|
{
|
||||||
|
[JsonIgnore]
|
||||||
BoolFeedback PartitionPresentFeedback { get; }
|
BoolFeedback PartitionPresentFeedback { get; }
|
||||||
|
|
||||||
|
[JsonProperty("partitionPresent")]
|
||||||
|
bool PartitionPresent { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -21,6 +21,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IPartitionController : IPartitionStateProvider
|
public interface IPartitionController : IPartitionStateProvider
|
||||||
{
|
{
|
||||||
|
[JsonProperty("adjacentRoomKeys")]
|
||||||
List<string> AdjacentRoomKeys { get; }
|
List<string> AdjacentRoomKeys { get; }
|
||||||
|
|
||||||
void SetPartitionStatePresent();
|
void SetPartitionStatePresent();
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using Serilog.Events;
|
using Serilog.Events;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core
|
namespace PepperDash.Essentials.Core
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
[JsonProperty("isInAutoMode")]
|
[JsonProperty("isInAutoMode")]
|
||||||
bool IsInAutoMode { get; }
|
bool IsInAutoMode { get; }
|
||||||
|
|
||||||
|
[JsonProperty("rooms")]
|
||||||
List<IKeyName> Rooms { get; }
|
List<IKeyName> Rooms { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -77,6 +78,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// When true, indicates that this room combination scenario is active
|
/// When true, indicates that this room combination scenario is active
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[JsonIgnore]
|
||||||
BoolFeedback IsActiveFeedback { get; }
|
BoolFeedback IsActiveFeedback { get; }
|
||||||
|
|
||||||
[JsonProperty("isActive")]
|
[JsonProperty("isActive")]
|
||||||
@@ -101,6 +103,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The mapping of UIs by key to rooms by key
|
/// The mapping of UIs by key to rooms by key
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[JsonProperty("uiMap")]
|
||||||
Dictionary<string, string> UiMap { get; set; }
|
Dictionary<string, string> UiMap { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user