Skip to content

Commit

Permalink
feat: add method to set a url for the panels
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-welker committed May 17, 2024
1 parent 0e5d21e commit 65b00e6
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions 3-series/MobileControlSystemController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using PepperDash.Core;
using PepperDash.Essentials.AppServer;
using PepperDash.Essentials.AppServer.Messengers;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
Expand Down Expand Up @@ -156,7 +157,7 @@ public MobileControlSystemController(string key, string name, MobileControlConfi
: base(key, name)
{
Config = config;

// The queue that will collect the incoming messages in the order they are received
//_receiveQueue = new ReceiveQueue(key, ParseStreamRx);
_receiveQueue = new GenericQueue(key + "-rxqueue", Crestron.SimplSharpPro.CrestronThread.Thread.eThreadPriority.HighPriority, 25);
Expand Down Expand Up @@ -206,7 +207,7 @@ public MobileControlSystemController(string key, string name, MobileControlConfi
return _wsClient2.IsAlive && IsAuthorized;
});
}
}

private void SetupDefaultRoomMessengers()
{
Expand Down Expand Up @@ -1435,6 +1436,17 @@ public MobileControlEssentialsConfig GetConfigWithPluginVersion()
return confObject;
}

public void SetClientUrl(string path, string roomKey = null)
{
var message = new MobileControlMessage
{
Type = string.IsNullOrEmpty(roomKey) ? $"/event/system/setUrl" : $"/event/room/{roomKey}/setUrl",
Content = JToken.FromObject(new MobileControlSimpleContent<string> { Value = path })
};

SendMessageObject(message);
}

/// <summary>
/// Sends any object type to server
/// </summary>
Expand Down Expand Up @@ -1582,12 +1594,7 @@ private void HandleClientJoined(JToken content)
});
}

private void HandleUserCode(JToken content)
{
HandleUserCode(content, null);
}

private void HandleUserCode(JToken content, Action<string, string> action)
private void HandleUserCode(JToken content, Action<string, string> action = null)
{
var code = content["userCode"];

Expand Down

0 comments on commit 65b00e6

Please sign in to comment.