mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-02 14:24:59 +00:00
Fixed issue with creating events in edge scenarios when properties change from Fusion
This commit is contained in:
@@ -832,7 +832,7 @@ namespace PepperDash.Essentials.Fusion
|
||||
if (handler != null)
|
||||
handler(this, new EventArgs());
|
||||
|
||||
CustomPropertiesBridge.EvaluateRoomInfo(roomInformation);
|
||||
CustomPropertiesBridge.EvaluateRoomInfo(Room.Key, roomInformation);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
|
||||
@@ -6,6 +6,7 @@ using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Room.Behaviours;
|
||||
|
||||
namespace PepperDash.Essentials.Fusion
|
||||
@@ -20,7 +21,7 @@ namespace PepperDash.Essentials.Fusion
|
||||
/// Evaluates the room info and custom properties from Fusion and updates the system properties aa needed
|
||||
/// </summary>
|
||||
/// <param name="roomInfo"></param>
|
||||
public void EvaluateRoomInfo(RoomInformation roomInfo)
|
||||
public void EvaluateRoomInfo(string roomKey, RoomInformation roomInfo)
|
||||
{
|
||||
var runtimeConfigurableDevices = DeviceManager.AllDevices.Where(d => d is IRuntimeConfigurableDevice);
|
||||
|
||||
@@ -28,6 +29,7 @@ namespace PepperDash.Essentials.Fusion
|
||||
{
|
||||
foreach (var device in runtimeConfigurableDevices)
|
||||
{
|
||||
// Get the current device config so new values can be overwritten over existing
|
||||
var deviceConfig = (device as IRuntimeConfigurableDevice).GetDeviceConfig();
|
||||
|
||||
if (device is RoomOnToDefaultSourceWhenOccupied)
|
||||
@@ -77,8 +79,19 @@ namespace PepperDash.Essentials.Fusion
|
||||
deviceConfig = devConfig;
|
||||
}
|
||||
|
||||
// Set the config on the device
|
||||
(device as IRuntimeConfigurableDevice).SetDeviceConfig(deviceConfig);
|
||||
}
|
||||
|
||||
//var roomConfig = ConfigReader.ConfigObject.Rooms.FirstOrDefault(r => r.Key.Equals(roomKey);
|
||||
|
||||
//if(roomConfig != null)
|
||||
//{
|
||||
// roomConfig.Name = roomInfo.Name;
|
||||
|
||||
// // Update HelpMessage in room properties
|
||||
// roomConfig.Properties.
|
||||
//}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
@@ -258,9 +258,11 @@ namespace PepperDash.Essentials.Room.Behaviours
|
||||
|
||||
// Set up its initial properties
|
||||
|
||||
schEvent.Acknowledgeable = true;
|
||||
if(!schEvent.Acknowledgeable)
|
||||
schEvent.Acknowledgeable = true;
|
||||
|
||||
schEvent.Persistent = true;
|
||||
if(!schEvent.Persistent)
|
||||
schEvent.Persistent = true;
|
||||
|
||||
schEvent.DateAndTime.SetFirstDayOfWeek(ScheduledEventCommon.eFirstDayOfWeek.Sunday);
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user