mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 13:15:03 +00:00
Updated EssentialsRoomBase and both extented types to use ReconfigurableDevice. Tested Fusion Custom Properties successfully updating room name and help message.
This commit is contained in:
@@ -37,6 +37,8 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
|
|
||||||
if (device is RoomOnToDefaultSourceWhenOccupied)
|
if (device is RoomOnToDefaultSourceWhenOccupied)
|
||||||
{
|
{
|
||||||
|
Debug.Console(1, "Mapping Room on via Occupancy values from Fusion");
|
||||||
|
|
||||||
var devProps = JsonConvert.DeserializeObject<RoomOnToDefaultSourceWhenOccupiedConfig>(deviceConfig.Properties.ToString());
|
var devProps = JsonConvert.DeserializeObject<RoomOnToDefaultSourceWhenOccupiedConfig>(deviceConfig.Properties.ToString());
|
||||||
|
|
||||||
var enableFeature = roomInfo.FusionCustomProperties.FirstOrDefault(p => p.ID.Equals("EnRoomOnWhenOccupied"));
|
var enableFeature = roomInfo.FusionCustomProperties.FirstOrDefault(p => p.ID.Equals("EnRoomOnWhenOccupied"));
|
||||||
@@ -84,13 +86,19 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
else if (device is EssentialsRoomBase)
|
else if (device is EssentialsRoomBase)
|
||||||
{
|
{
|
||||||
// Set the room name
|
// Set the room name
|
||||||
deviceConfig.Name = roomInfo.Name;
|
if (!string.IsNullOrEmpty(roomInfo.Name))
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Current Room Name: {0}. New Room Name: {1}", deviceConfig.Name, roomInfo.Name);
|
||||||
|
deviceConfig.Name = roomInfo.Name;
|
||||||
|
Debug.Console(1, "Room Name Successfully Changed.");
|
||||||
|
}
|
||||||
|
|
||||||
// Set the help message
|
// Set the help message
|
||||||
var helpMessage = roomInfo.FusionCustomProperties.FirstOrDefault(p => p.ID.Equals("RoomHelpMessage"));
|
var helpMessage = roomInfo.FusionCustomProperties.FirstOrDefault(p => p.ID.Equals("RoomHelpMessage"));
|
||||||
if (helpMessage != null)
|
if (helpMessage != null)
|
||||||
{
|
{
|
||||||
deviceConfig.Properties["Help"]["Message"].Value<string>(helpMessage.CustomFieldValue);
|
//Debug.Console(1, "Current Help Message: {0}. New Help Message: {1}", deviceConfig.Properties["help"]["message"].Value<string>(ToString()), helpMessage.CustomFieldValue);
|
||||||
|
deviceConfig.Properties["helpMessage"] = (string)helpMessage.CustomFieldValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,5 +4,5 @@
|
|||||||
[assembly: AssemblyCompany("PepperDash Technology Corp")]
|
[assembly: AssemblyCompany("PepperDash Technology Corp")]
|
||||||
[assembly: AssemblyProduct("PepperDashEssentials")]
|
[assembly: AssemblyProduct("PepperDashEssentials")]
|
||||||
[assembly: AssemblyCopyright("Copyright © PepperDash Technology Corp 2018")]
|
[assembly: AssemblyCopyright("Copyright © PepperDash Technology Corp 2018")]
|
||||||
[assembly: AssemblyVersion("1.2.6.*")]
|
[assembly: AssemblyVersion("1.3.0.*")]
|
||||||
|
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ namespace PepperDash.Essentials.Room.Behaviours
|
|||||||
var newPropertiesConfig = JsonConvert.DeserializeObject<RoomOnToDefaultSourceWhenOccupiedConfig>(config.Properties.ToString());
|
var newPropertiesConfig = JsonConvert.DeserializeObject<RoomOnToDefaultSourceWhenOccupiedConfig>(config.Properties.ToString());
|
||||||
|
|
||||||
if(newPropertiesConfig != null)
|
if(newPropertiesConfig != null)
|
||||||
PropertiesConfig = newPropertiesConfig;
|
PropertiesConfig = newPropertiesConfig;
|
||||||
|
|
||||||
ConfigWriter.UpdateDeviceConfig(config);
|
ConfigWriter.UpdateDeviceConfig(config);
|
||||||
|
|
||||||
|
|||||||
@@ -24,63 +24,13 @@ namespace PepperDash.Essentials.Room.Config
|
|||||||
var typeName = roomConfig.Type.ToLower();
|
var typeName = roomConfig.Type.ToLower();
|
||||||
if (typeName == "huddle")
|
if (typeName == "huddle")
|
||||||
{
|
{
|
||||||
var props = JsonConvert.DeserializeObject<EssentialsHuddleRoomPropertiesConfig>
|
var huddle = new EssentialsHuddleSpaceRoom(roomConfig);
|
||||||
(roomConfig.Properties.ToString());
|
|
||||||
var disp = DeviceManager.GetDeviceForKey(props.DefaultDisplayKey) as IRoutingSinkWithSwitching;
|
|
||||||
var audio = DeviceManager.GetDeviceForKey(props.DefaultAudioKey) as IRoutingSinkNoSwitching;
|
|
||||||
var huddle = new EssentialsHuddleSpaceRoom(roomConfig.Key, roomConfig.Name, disp, audio, props);
|
|
||||||
|
|
||||||
if (props.Occupancy != null)
|
|
||||||
huddle.SetRoomOccupancy(DeviceManager.GetDeviceForKey(props.Occupancy.DeviceKey) as
|
|
||||||
PepperDash.Essentials.Devices.Common.Occupancy.IOccupancyStatusProvider, props.Occupancy.TimoutMinutes);
|
|
||||||
huddle.LogoUrl = props.Logo.GetUrl();
|
|
||||||
huddle.SourceListKey = props.SourceListKey;
|
|
||||||
huddle.DefaultSourceItem = props.DefaultSourceItem;
|
|
||||||
huddle.DefaultVolume = (ushort)(props.Volumes.Master.Level * 65535 / 100);
|
|
||||||
return huddle;
|
return huddle;
|
||||||
}
|
}
|
||||||
//else if (typeName == "presentation")
|
|
||||||
//{
|
|
||||||
// var props = JsonConvert.DeserializeObject<EssentialsPresentationRoomPropertiesConfig>
|
|
||||||
// (this.Properties.ToString());
|
|
||||||
// var displaysDict = new Dictionary<uint, IRoutingSinkNoSwitching>();
|
|
||||||
// uint i = 1;
|
|
||||||
// foreach (var dispKey in props.DisplayKeys) // read in the ordered displays list
|
|
||||||
// {
|
|
||||||
// var disp = DeviceManager.GetDeviceForKey(dispKey) as IRoutingSinkWithSwitching;
|
|
||||||
// displaysDict.Add(i++, disp);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // Get the master volume control
|
|
||||||
// IBasicVolumeWithFeedback masterVolumeControlDev = props.Volumes.Master.GetDevice();
|
|
||||||
|
|
||||||
|
|
||||||
// var presRoom = new EssentialsPresentationRoom(Key, Name, displaysDict, masterVolumeControlDev, props);
|
|
||||||
// return presRoom;
|
|
||||||
//}
|
|
||||||
else if (typeName == "huddlevtc1")
|
else if (typeName == "huddlevtc1")
|
||||||
{
|
{
|
||||||
var props = JsonConvert.DeserializeObject<EssentialsHuddleVtc1PropertiesConfig>
|
var rm = new EssentialsHuddleVtc1Room(roomConfig);
|
||||||
(roomConfig.Properties.ToString());
|
|
||||||
var disp = DeviceManager.GetDeviceForKey(props.DefaultDisplayKey) as IRoutingSinkWithSwitching;
|
|
||||||
|
|
||||||
var codec = DeviceManager.GetDeviceForKey(props.VideoCodecKey) as
|
|
||||||
PepperDash.Essentials.Devices.Common.VideoCodec.VideoCodecBase;
|
|
||||||
|
|
||||||
var rm = new EssentialsHuddleVtc1Room(roomConfig.Key, roomConfig.Name, disp, codec, codec, props);
|
|
||||||
// Add Occupancy object from config
|
|
||||||
|
|
||||||
if (props.Occupancy != null)
|
|
||||||
rm.SetRoomOccupancy(DeviceManager.GetDeviceForKey(props.Occupancy.DeviceKey) as
|
|
||||||
PepperDash.Essentials.Devices.Common.Occupancy.IOccupancyStatusProvider, props.Occupancy.TimoutMinutes);
|
|
||||||
rm.LogoUrl = props.Logo.GetUrl();
|
|
||||||
rm.SourceListKey = props.SourceListKey;
|
|
||||||
rm.DefaultSourceItem = props.DefaultSourceItem;
|
|
||||||
rm.DefaultVolume = (ushort)(props.Volumes.Master.Level * 65535 / 100);
|
|
||||||
|
|
||||||
rm.MicrophonePrivacy = GetMicrophonePrivacy(props, rm); // Get Microphone Privacy object, if any
|
|
||||||
|
|
||||||
rm.Emergency = GetEmergency(props, rm); // Get emergency object, if any
|
|
||||||
|
|
||||||
return rm;
|
return rm;
|
||||||
}
|
}
|
||||||
@@ -96,7 +46,7 @@ namespace PepperDash.Essentials.Room.Config
|
|||||||
/// Gets and operating, standalone emergegncy object that can be plugged into a room.
|
/// Gets and operating, standalone emergegncy object that can be plugged into a room.
|
||||||
/// Returns null if there is no emergency defined
|
/// Returns null if there is no emergency defined
|
||||||
/// </summary>
|
/// </summary>
|
||||||
static EssentialsRoomEmergencyBase GetEmergency(EssentialsRoomPropertiesConfig props, EssentialsRoomBase room)
|
public static EssentialsRoomEmergencyBase GetEmergency(EssentialsRoomPropertiesConfig props, EssentialsRoomBase room)
|
||||||
{
|
{
|
||||||
// This emergency
|
// This emergency
|
||||||
var emergency = props.Emergency;
|
var emergency = props.Emergency;
|
||||||
@@ -115,7 +65,7 @@ namespace PepperDash.Essentials.Room.Config
|
|||||||
/// <param name="props"></param>
|
/// <param name="props"></param>
|
||||||
/// <param name="room"></param>
|
/// <param name="room"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
static PepperDash.Essentials.Devices.Common.Microphones.MicrophonePrivacyController GetMicrophonePrivacy(
|
public static PepperDash.Essentials.Devices.Common.Microphones.MicrophonePrivacyController GetMicrophonePrivacy(
|
||||||
EssentialsRoomPropertiesConfig props, EssentialsHuddleVtc1Room room)
|
EssentialsRoomPropertiesConfig props, EssentialsHuddleVtc1Room room)
|
||||||
{
|
{
|
||||||
var microphonePrivacy = props.MicrophonePrivacy;
|
var microphonePrivacy = props.MicrophonePrivacy;
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
@@ -66,7 +68,7 @@ namespace PepperDash.Essentials
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public EssentialsRoomPropertiesConfig PropertiesConfig { get; private set; }
|
public EssentialsHuddleRoomPropertiesConfig PropertiesConfig { get; private set; }
|
||||||
|
|
||||||
public IRoutingSinkWithSwitching DefaultDisplay { get; private set; }
|
public IRoutingSinkWithSwitching DefaultDisplay { get; private set; }
|
||||||
public IRoutingSinkNoSwitching DefaultAudioDevice { get; private set; }
|
public IRoutingSinkNoSwitching DefaultAudioDevice { get; private set; }
|
||||||
@@ -147,22 +149,32 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
public string CurrentSourceInfoKey { get; private set; }
|
public string CurrentSourceInfoKey { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
public EssentialsHuddleSpaceRoom(DeviceConfig config)
|
||||||
///
|
: base(config)
|
||||||
/// </summary>
|
{
|
||||||
/// <param name="key"></param>
|
try
|
||||||
/// <param name="name"></param>
|
{
|
||||||
public EssentialsHuddleSpaceRoom(string key, string name, IRoutingSinkWithSwitching defaultDisplay,
|
PropertiesConfig = JsonConvert.DeserializeObject<EssentialsHuddleRoomPropertiesConfig>
|
||||||
IRoutingSinkNoSwitching defaultAudio, EssentialsRoomPropertiesConfig config)
|
(config.Properties.ToString());
|
||||||
: base(key, name)
|
DefaultDisplay = DeviceManager.GetDeviceForKey(PropertiesConfig.DefaultDisplayKey) as IRoutingSinkWithSwitching;
|
||||||
|
|
||||||
|
|
||||||
|
DefaultAudioDevice = DeviceManager.GetDeviceForKey(PropertiesConfig.DefaultAudioKey) as IRoutingSinkWithSwitching;
|
||||||
|
|
||||||
|
Initialize();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Error building room: \n{0}", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Initialize()
|
||||||
{
|
{
|
||||||
PropertiesConfig = config;
|
if (DefaultAudioDevice is IBasicVolumeControls)
|
||||||
DefaultDisplay = defaultDisplay;
|
DefaultVolumeControls = DefaultAudioDevice as IBasicVolumeControls;
|
||||||
DefaultAudioDevice = defaultAudio;
|
else if (DefaultAudioDevice is IHasVolumeDevice)
|
||||||
if (defaultAudio is IBasicVolumeControls)
|
DefaultVolumeControls = (DefaultAudioDevice as IHasVolumeDevice).VolumeDevice;
|
||||||
DefaultVolumeControls = defaultAudio as IBasicVolumeControls;
|
|
||||||
else if (defaultAudio is IHasVolumeDevice)
|
|
||||||
DefaultVolumeControls = (defaultAudio as IHasVolumeDevice).VolumeDevice;
|
|
||||||
CurrentVolumeControls = DefaultVolumeControls;
|
CurrentVolumeControls = DefaultVolumeControls;
|
||||||
|
|
||||||
var disp = DefaultDisplay as DisplayBase;
|
var disp = DefaultDisplay as DisplayBase;
|
||||||
@@ -195,6 +207,15 @@ namespace PepperDash.Essentials
|
|||||||
EnablePowerOnToLastSource = true;
|
EnablePowerOnToLastSource = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void CustomSetConfig(DeviceConfig config)
|
||||||
|
{
|
||||||
|
var newPropertiesConfig = JsonConvert.DeserializeObject<EssentialsHuddleRoomPropertiesConfig>(config.Properties.ToString());
|
||||||
|
|
||||||
|
if (newPropertiesConfig != null)
|
||||||
|
PropertiesConfig = newPropertiesConfig;
|
||||||
|
|
||||||
|
ConfigWriter.UpdateRoomConfig(config);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -225,6 +246,21 @@ namespace PepperDash.Essentials
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override bool CustomActivate()
|
||||||
|
{
|
||||||
|
// Add Occupancy object from config
|
||||||
|
if (PropertiesConfig.Occupancy != null)
|
||||||
|
this.SetRoomOccupancy(DeviceManager.GetDeviceForKey(PropertiesConfig.Occupancy.DeviceKey) as
|
||||||
|
PepperDash.Essentials.Devices.Common.Occupancy.IOccupancyStatusProvider, PropertiesConfig.Occupancy.TimoutMinutes);
|
||||||
|
|
||||||
|
this.LogoUrl = PropertiesConfig.Logo.GetUrl();
|
||||||
|
this.SourceListKey = PropertiesConfig.SourceListKey;
|
||||||
|
this.DefaultSourceItem = PropertiesConfig.DefaultSourceItem;
|
||||||
|
this.DefaultVolume = (ushort)(PropertiesConfig.Volumes.Master.Level * 65535 / 100);
|
||||||
|
|
||||||
|
return base.CustomActivate();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
@@ -195,26 +197,37 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
CCriticalSection SourceSelectLock = new CCriticalSection();
|
CCriticalSection SourceSelectLock = new CCriticalSection();
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="key"></param>
|
|
||||||
/// <param name="name"></param>
|
|
||||||
public EssentialsHuddleVtc1Room(string key, string name, IRoutingSinkWithSwitching defaultDisplay,
|
|
||||||
IBasicVolumeControls defaultAudio, VideoCodecBase codec, EssentialsHuddleVtc1PropertiesConfig config)
|
|
||||||
: base(key, name)
|
|
||||||
{
|
|
||||||
if (codec == null)
|
|
||||||
throw new ArgumentNullException("codec cannot be null");
|
|
||||||
PropertiesConfig = config;
|
|
||||||
DefaultDisplay = defaultDisplay;
|
|
||||||
VideoCodec = codec;
|
|
||||||
DefaultAudioDevice = defaultAudio;
|
|
||||||
|
|
||||||
if (defaultAudio is IBasicVolumeControls)
|
public EssentialsHuddleVtc1Room(DeviceConfig config)
|
||||||
DefaultVolumeControls = defaultAudio as IBasicVolumeControls;
|
: base(config)
|
||||||
else if (defaultAudio is IHasVolumeDevice)
|
{
|
||||||
DefaultVolumeControls = (defaultAudio as IHasVolumeDevice).VolumeDevice;
|
try
|
||||||
|
{
|
||||||
|
PropertiesConfig = JsonConvert.DeserializeObject<EssentialsHuddleVtc1PropertiesConfig>
|
||||||
|
(config.Properties.ToString());
|
||||||
|
DefaultDisplay = DeviceManager.GetDeviceForKey(PropertiesConfig.DefaultDisplayKey) as IRoutingSinkWithSwitching;
|
||||||
|
|
||||||
|
VideoCodec = DeviceManager.GetDeviceForKey(PropertiesConfig.VideoCodecKey) as
|
||||||
|
PepperDash.Essentials.Devices.Common.VideoCodec.VideoCodecBase;
|
||||||
|
if (VideoCodec == null)
|
||||||
|
throw new ArgumentNullException("codec cannot be null");
|
||||||
|
|
||||||
|
DefaultAudioDevice = DeviceManager.GetDeviceForKey(PropertiesConfig.DefaultAudioKey) as IBasicVolumeControls;
|
||||||
|
|
||||||
|
Initialize();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Error building room: \n{0}", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Initialize()
|
||||||
|
{
|
||||||
|
if (DefaultAudioDevice is IBasicVolumeControls)
|
||||||
|
DefaultVolumeControls = DefaultAudioDevice as IBasicVolumeControls;
|
||||||
|
else if (DefaultAudioDevice is IHasVolumeDevice)
|
||||||
|
DefaultVolumeControls = (DefaultAudioDevice as IHasVolumeDevice).VolumeDevice;
|
||||||
CurrentVolumeControls = DefaultVolumeControls;
|
CurrentVolumeControls = DefaultVolumeControls;
|
||||||
|
|
||||||
|
|
||||||
@@ -264,6 +277,37 @@ namespace PepperDash.Essentials
|
|||||||
EnablePowerOnToLastSource = true;
|
EnablePowerOnToLastSource = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void CustomSetConfig(DeviceConfig config)
|
||||||
|
{
|
||||||
|
var newPropertiesConfig = JsonConvert.DeserializeObject<EssentialsHuddleVtc1PropertiesConfig>(config.Properties.ToString());
|
||||||
|
|
||||||
|
if (newPropertiesConfig != null)
|
||||||
|
PropertiesConfig = newPropertiesConfig;
|
||||||
|
|
||||||
|
ConfigWriter.UpdateRoomConfig(config);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool CustomActivate()
|
||||||
|
{
|
||||||
|
// Add Occupancy object from config
|
||||||
|
if (PropertiesConfig.Occupancy != null)
|
||||||
|
this.SetRoomOccupancy(DeviceManager.GetDeviceForKey(PropertiesConfig.Occupancy.DeviceKey) as
|
||||||
|
PepperDash.Essentials.Devices.Common.Occupancy.IOccupancyStatusProvider, PropertiesConfig.Occupancy.TimoutMinutes);
|
||||||
|
|
||||||
|
this.LogoUrl = PropertiesConfig.Logo.GetUrl();
|
||||||
|
this.SourceListKey = PropertiesConfig.SourceListKey;
|
||||||
|
this.DefaultSourceItem = PropertiesConfig.DefaultSourceItem;
|
||||||
|
this.DefaultVolume = (ushort)(PropertiesConfig.Volumes.Master.Level * 65535 / 100);
|
||||||
|
|
||||||
|
// Get Microphone Privacy object, if any
|
||||||
|
this.MicrophonePrivacy = EssentialsRoomConfigHelper.GetMicrophonePrivacy(PropertiesConfig, this);
|
||||||
|
|
||||||
|
// Get emergency object, if any
|
||||||
|
this.Emergency = EssentialsRoomConfigHelper.GetEmergency(PropertiesConfig, this);
|
||||||
|
|
||||||
|
return base.CustomActivate();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using Crestron.SimplSharp.Scheduler;
|
|||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.Core.Devices;
|
using PepperDash.Essentials.Core.Devices;
|
||||||
using PepperDash.Essentials.Devices.Common.Occupancy;
|
using PepperDash.Essentials.Devices.Common.Occupancy;
|
||||||
|
|
||||||
@@ -122,50 +123,6 @@ namespace PepperDash.Essentials
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
///// <summary>
|
|
||||||
/////
|
|
||||||
///// </summary>
|
|
||||||
///// <param name="key"></param>
|
|
||||||
///// <param name="name"></param>
|
|
||||||
//public EssentialsRoomBase(string key, string name) : base(key, name)
|
|
||||||
//{
|
|
||||||
// // Setup the ShutdownPromptTimer
|
|
||||||
// ShutdownPromptTimer = new SecondsCountdownTimer(Key + "-offTimer");
|
|
||||||
// ShutdownPromptTimer.IsRunningFeedback.OutputChange += (o, a) =>
|
|
||||||
// {
|
|
||||||
// if (!ShutdownPromptTimer.IsRunningFeedback.BoolValue)
|
|
||||||
// ShutdownType = eShutdownType.None;
|
|
||||||
// };
|
|
||||||
// ShutdownPromptTimer.HasFinished += (o, a) => Shutdown(); // Shutdown is triggered
|
|
||||||
|
|
||||||
// ShutdownPromptSeconds = 60;
|
|
||||||
// ShutdownVacancySeconds = 120;
|
|
||||||
// ShutdownType = eShutdownType.None;
|
|
||||||
|
|
||||||
// RoomVacancyShutdownTimer = new SecondsCountdownTimer(Key + "-vacancyOffTimer");
|
|
||||||
// //RoomVacancyShutdownTimer.IsRunningFeedback.OutputChange += (o, a) =>
|
|
||||||
// //{
|
|
||||||
// // if (!RoomVacancyShutdownTimer.IsRunningFeedback.BoolValue)
|
|
||||||
// // ShutdownType = ShutdownType.Vacancy;
|
|
||||||
// //};
|
|
||||||
// RoomVacancyShutdownTimer.HasFinished += new EventHandler<EventArgs>(RoomVacancyShutdownPromptTimer_HasFinished); // Shutdown is triggered
|
|
||||||
|
|
||||||
// RoomVacancyShutdownPromptSeconds = 1500; // 25 min to prompt warning
|
|
||||||
// RoomVacancyShutdownSeconds = 240; // 4 min after prompt will trigger shutdown prompt
|
|
||||||
// VacancyMode = eVacancyMode.None;
|
|
||||||
|
|
||||||
// OnFeedback = new BoolFeedback(OnFeedbackFunc);
|
|
||||||
|
|
||||||
// IsWarmingUpFeedback = new BoolFeedback(IsWarmingFeedbackFunc);
|
|
||||||
// IsCoolingDownFeedback = new BoolFeedback(IsCoolingFeedbackFunc);
|
|
||||||
|
|
||||||
// AddPostActivationAction(() =>
|
|
||||||
// {
|
|
||||||
// if (RoomOccupancy != null)
|
|
||||||
// OnRoomOccupancyIsSet();
|
|
||||||
// });
|
|
||||||
//}
|
|
||||||
|
|
||||||
void RoomVacancyShutdownPromptTimer_HasFinished(object sender, EventArgs e)
|
void RoomVacancyShutdownPromptTimer_HasFinished(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
switch (VacancyMode)
|
switch (VacancyMode)
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Submodule essentials-framework updated: d351b879c2...7422e08b5d
Reference in New Issue
Block a user