Skip to content

Commit 2f3ea6e

Browse files
committed
Fixed an issue with sendToPlugin not including device
1 parent d125117 commit 2f3ea6e

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/SharpDeck/Events/StreamDeckAction.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,8 @@ public Task SetStateAsync(int state = 0)
8888
/// <summary>
8989
/// Send a payload to the Property Inspector.
9090
/// </summary>
91-
/// <param name="context">An opaque value identifying the instances action.</param>
92-
/// <param name="action">The action unique identifier.</param>
9391
/// <param name="payload">A JSON object that will be received by the Property Inspector.</param>
94-
public Task SendToPropertyInspectorAsync(string context, string action, object payload)
92+
public Task SendToPropertyInspectorAsync(object payload)
9593
=> this.StreamDeck.SendToPropertyInspectorAsync(this.Context, this.ActionUUID, payload);
9694

9795
/// <summary>

src/SharpDeck/Events/StreamDeckEventRouter.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ public void Route(StreamDeckClient client, WebSocketMessageEventArgs e)
6161

6262
// when the event is not an action, allow the default Stream Deck client to handle the event
6363
if (!args.TryGetString(nameof(ActionEventArgs<object>.Action), out var actionUUID)
64-
|| !args.TryGetString(nameof(ActionEventArgs<object>.Context), out var context)
65-
|| !args.TryGetString(nameof(ActionEventArgs<object>.Device), out var device))
64+
|| !args.TryGetString(nameof(ActionEventArgs<object>.Context), out var context))
6665
{
6766
client.TryHandleReceivedEvent(@event, args);
6867
return;
6968
}
7069

71-
// otherwise get the action, and try to handle the event
70+
// otherwise get the action, and try to handle the event; device is not specified when "sendToPlugin" is called
71+
args.TryGetString(nameof(ActionEventArgs<object>.Device), out var device);
7272
this.GetActionOrClient(actionUUID, context, device, client)
7373
.TryHandleReceivedEvent(@event, args);
7474
}

0 commit comments

Comments
 (0)