New Room on to default source feature working using scheduled events and built in scheduler based on config values

This commit is contained in:
Neil Dorin
2018-08-24 18:08:25 -06:00
parent c0c90f926e
commit bd31d76e8b
6 changed files with 503 additions and 151 deletions

View File

@@ -2,7 +2,9 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharp;
using Crestron.SimplSharp.Scheduler;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Devices.Common.Occupancy;
@@ -60,22 +62,6 @@ namespace PepperDash.Essentials
/// Seconds after vacancy detected until prompt is displayed
/// </summary>
protected int RoomVacancyShutdownPromptSeconds;
/// <summary>
/// The time of day at which the room occupancy power on feature should be enabled
/// </summary>
protected DateTime RoomOccpuancyPowerOnStart;
/// <summary>
/// The time of day at which the room occupancy power on feature should be disabled
/// </summary>
protected DateTime RoomOccupancyPowerOnEnd;
/// <summary>
/// Should the room power on to the default source if occupied between the start and end times
/// </summary>
protected bool RoomOccupancyPowerOnIsEnabled;
/// <summary>
///
@@ -239,16 +225,6 @@ namespace PepperDash.Essentials
Debug.Console(1, this, "Notice: Occupancy Detected");
// Reset the timer when the room is occupied
RoomVacancyShutdownTimer.Cancel();
if(RoomOccupancyPowerOnIsEnabled)
{
var currentTime = DateTime.Now.TimeOfDay;
if (currentTime.CompareTo(RoomOccpuancyPowerOnStart.TimeOfDay) > 0 && RoomOccupancyPowerOnEnd.TimeOfDay.CompareTo(currentTime) > 0)
{
PowerOnToDefaultOrLastSource();
}
}
}
}
@@ -257,7 +233,7 @@ namespace PepperDash.Essentials
/// </summary>
void SetUpOccupancyRoomOnEventsInScheduler()
{
}
/// <summary>