Skip to content

Commit

Permalink
feat: Adds LevelControlList to room configuration and adds ILvelContr…
Browse files Browse the repository at this point in the history
…olsMessenger to room if implmented
  • Loading branch information
ndorin committed May 17, 2024
1 parent 77a5a7a commit 0b07094
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
20 changes: 20 additions & 0 deletions 3-series/MobileControlSystemController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
using PepperDash.Essentials.WebApiHandlers;
using Serilog.Events;
using WebSocketSharp;
using static Crestron.SimplSharpPro.Lighting.ZumWired.ZumNetBridgeRoom.ZumWiredRoomInterface;
using DisplayBase = PepperDash.Essentials.Devices.Common.Displays.DisplayBase;
using TwoWayDisplayBase = PepperDash.Essentials.Devices.Common.Displays.TwoWayDisplayBase;
#if SERIES4
Expand Down Expand Up @@ -279,6 +280,8 @@ private void SetupDefaultRoomMessengers()

if (room is IRoomEventSchedule)
{
Debug.LogMessage(LogEventLevel.Information, "Setting up event schedule messenger for room: {key}", this, room.Key);

var scheduleMessenger = new RoomEventScheduleMessenger(
$"{room.Key}-schedule-{Key}",
string.Format("/room/{0}", room.Key),
Expand All @@ -290,6 +293,8 @@ room as IRoomEventSchedule

if (room is ITechPassword)
{
Debug.LogMessage(LogEventLevel.Information, "Setting up tech password messenger for room: {key}", this, room.Key);

var techPasswordMessenger = new ITechPasswordMessenger(
$"{room.Key}-techPassword-{Key}",
string.Format("/room/{0}", room.Key),
Expand All @@ -301,6 +306,8 @@ room as ITechPassword

if (room is IShutdownPromptTimer)
{
Debug.LogMessage(LogEventLevel.Information, "Setting up shutdown prompt timer messenger for room: {key}", this, room.Key);

var shutdownPromptTimerMessenger = new IShutdownPromptTimerMessenger(
$"{room.Key}-shutdownPromptTimer-{Key}",
string.Format("/room/{0}", room.Key),
Expand All @@ -309,6 +316,19 @@ room as IShutdownPromptTimer

AddDefaultDeviceMessenger(shutdownPromptTimerMessenger);
}

if (room is ILevelControls levelControls)
{
Debug.LogMessage(LogEventLevel.Information, "Setting up level controls messenger for room: {key}", this, room.Key);

var levelControlsMessenger = new ILevelControlsMessenger(
$"{room.Key}-levelControls-{Key}",
$"/room/{room.Key}",
levelControls
);

AddDefaultDeviceMessenger(levelControlsMessenger);
}
}
}

Expand Down
11 changes: 10 additions & 1 deletion 3-series/RoomBridges/MobileControlEssentialsRoomBridge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,6 @@ private RoomStateMessage GetFullStatusForClientId(IEssentialsRoom room)
}

volumes.Add("master", volume);

}
}

Expand Down Expand Up @@ -757,6 +756,13 @@ private RoomConfiguration GetRoomConfiguration(IEssentialsRoom room)
{
configuration.DestinationList = destinationList;
}

var levelControlList = ConfigReader.ConfigObject.GetLevelControlListForKey(room.LevelControlListKey);

if(levelControlList != null)
{
configuration.LevelControlList = levelControlList;
}


return configuration;
Expand Down Expand Up @@ -857,6 +863,9 @@ public class RoomConfiguration
[JsonProperty("destinationList", NullValueHandling = NullValueHandling.Ignore)]
public Dictionary<string, DestinationListItem> DestinationList { get; set;}

[JsonProperty("levelListControl", NullValueHandling = NullValueHandling.Ignore)]
public Dictionary<string, LevelControlListItem> LevelControlList { get; set; }

[JsonProperty("defaultPresentationSourceKey", NullValueHandling = NullValueHandling.Ignore)]
public string DefaultPresentationSourceKey { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<DefineConstants>TRACE;SERIES4</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="PepperDashEssentials" Version="2.0.0-alpha-2488" />
<PackageReference Include="PepperDashEssentials" Version="2.0.0-alpha-2499" />
<PackageReference Include="WebSocketSharp-netstandard" Version="1.0.1" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@
<Folder Include="SIMPLJoinMaps\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="PepperDashEssentials" Version="2.0.0-alpha-2488" />
<PackageReference Include="PepperDashEssentials" Version="2.0.0-alpha-2499" />
</ItemGroup>
</Project>

0 comments on commit 0b07094

Please sign in to comment.