mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-08 17:24:47 +00:00
45 lines
1.3 KiB
C#
45 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using Crestron.SimplSharp;
|
|
|
|
using PepperDash.Core;
|
|
using PepperDash.Essentials.Core;
|
|
|
|
namespace PepperDash.Essentials.Devices.Common.Occupancy
|
|
{
|
|
/// <summary>
|
|
/// Aggregates the RoomIsOccupied feedbacks of one or more IOccupancyStatusProvider objects
|
|
/// </summary>
|
|
public class IOccupancyStatusProviderAggregator : Device, IOccupancyStatusProvider
|
|
{
|
|
/// <summary>
|
|
/// Aggregated feedback of all linked IOccupancyStatusProvider devices
|
|
/// </summary>
|
|
public BoolFeedback RoomIsOccupiedFeedback
|
|
{
|
|
get
|
|
{
|
|
return AggregatedOccupancyStatus.Output;
|
|
}
|
|
}
|
|
|
|
private BoolFeedbackOr AggregatedOccupancyStatus;
|
|
|
|
public IOccupancyStatusProviderAggregator(string key, string name)
|
|
: base(key, name)
|
|
{
|
|
AggregatedOccupancyStatus = new BoolFeedbackOr();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Adds an IOccupancyStatusProvider device
|
|
/// </summary>
|
|
/// <param name="statusProvider"></param>
|
|
public void AddOccupancyStatusProvider(IOccupancyStatusProvider statusProvider)
|
|
{
|
|
AggregatedOccupancyStatus.AddOutputIn(statusProvider.RoomIsOccupiedFeedback);
|
|
}
|
|
}
|
|
} |