@@ -29,20 +29,27 @@ class PluginManager:
2929 def __init__ (
3030 self ,
3131 port : int ,
32- plugin_uuid : str , # Passed in by Streamdeck to the entry-point script. should we compare what's in the manifest.json file?
32+ plugin_uuid : str ,
33+ plugin_registration_uuid : str , # Passed in by Streamdeck to the entry-point script. should we compare what's in the manifest.json file?
3334 register_event : Literal ["registerPlugin" ], # Passed in by Streamdeck to the entry-point script. Will this always be "registerPlugin"?
3435 info : dict [str , Any ]
3536 ):
3637 """Initialize a PluginManager instance.
3738
3839 Args:
3940 port (int): The port number for WebSocket connection.
40- plugin_uuid (str): The unique identifier for the plugin.
41- register_event (str): The registration event type.
41+ plugin_uuid (str): The unique identifier for the plugin, as configured in the manifest.json file.
42+ This can be retrieved either from the manifest.json, or from the -info json object string option passed in by
43+ the Stream Deck software under `{"plugin": {"uuid": "MY-PLUGIN-UUID"}}`
44+ plugin_registration_uuid (str): Randomly-generated unique ID passed in by Stream Deck as -pluginUUID option,
45+ used to send back in the registerPlugin event.
46+ register_event (str): The registration event type, passed in by the Stream Deck software as -registerEvent option.
47+ It's value will almost definitely will be "registerPlugin".
4248 info (dict[str, Any]): The information related to the plugin.
4349 """
4450 self ._port = port
4551 self .uuid = plugin_uuid
52+ self ._registration_uuid = plugin_registration_uuid
4653 self ._register_event = register_event
4754 self ._info = info
4855
@@ -65,7 +72,7 @@ def run(self) -> None:
6572 with WebSocketClient (port = self ._port ) as client :
6673 command_sender = StreamDeckCommandSender (client )
6774
68- command_sender .send_action_registration (register_event = self ._register_event , plugin_uuid = self .uuid )
75+ command_sender .send_action_registration (register_event = self ._register_event , plugin_registration_uuid = self ._registration_uuid )
6976
7077 for message in client .listen_forever ():
7178 data : EventBase = event_adapter .validate_json (message )
0 commit comments