mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-12 12:06:58 +00:00
Fixed issue with creating events in edge scenarios when properties change from Fusion
This commit is contained in:
parent
7112c50f5a
commit
065075aabd
5 changed files with 19 additions and 4 deletions
|
|
@ -832,7 +832,7 @@ namespace PepperDash.Essentials.Fusion
|
||||||
if (handler != null)
|
if (handler != null)
|
||||||
handler(this, new EventArgs());
|
handler(this, new EventArgs());
|
||||||
|
|
||||||
CustomPropertiesBridge.EvaluateRoomInfo(roomInformation);
|
CustomPropertiesBridge.EvaluateRoomInfo(Room.Key, roomInformation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ using Crestron.SimplSharp;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.Room.Behaviours;
|
using PepperDash.Essentials.Room.Behaviours;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Fusion
|
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
|
/// Evaluates the room info and custom properties from Fusion and updates the system properties aa needed
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="roomInfo"></param>
|
/// <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);
|
var runtimeConfigurableDevices = DeviceManager.AllDevices.Where(d => d is IRuntimeConfigurableDevice);
|
||||||
|
|
||||||
|
|
@ -28,6 +29,7 @@ namespace PepperDash.Essentials.Fusion
|
||||||
{
|
{
|
||||||
foreach (var device in runtimeConfigurableDevices)
|
foreach (var device in runtimeConfigurableDevices)
|
||||||
{
|
{
|
||||||
|
// Get the current device config so new values can be overwritten over existing
|
||||||
var deviceConfig = (device as IRuntimeConfigurableDevice).GetDeviceConfig();
|
var deviceConfig = (device as IRuntimeConfigurableDevice).GetDeviceConfig();
|
||||||
|
|
||||||
if (device is RoomOnToDefaultSourceWhenOccupied)
|
if (device is RoomOnToDefaultSourceWhenOccupied)
|
||||||
|
|
@ -77,8 +79,19 @@ namespace PepperDash.Essentials.Fusion
|
||||||
deviceConfig = devConfig;
|
deviceConfig = devConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set the config on the device
|
||||||
(device as IRuntimeConfigurableDevice).SetDeviceConfig(deviceConfig);
|
(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)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -258,9 +258,11 @@ namespace PepperDash.Essentials.Room.Behaviours
|
||||||
|
|
||||||
// Set up its initial properties
|
// 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);
|
schEvent.DateAndTime.SetFirstDayOfWeek(ScheduledEventCommon.eFirstDayOfWeek.Sunday);
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue