elgatosf / streamdeck-plugin-template

A starting place for a new JavaScript Stream Deck plugin.
MIT License
180 stars 69 forks source link

How do I get settings in inspector.js? #14

Closed developer-47 closed 5 months ago

developer-47 commented 5 months ago

I'm almost done with my first plugin, but there's still an issue:

When I close and reopen the Property Inspector, the data from the input fields obviously disappears.

I allready can get the settings in the app.js, when I open the Property inspector, via the onPropertyInspectorDidAppear method:

myAction.onPropertyInspectorDidAppear(({action, context, device, event}) => { $SD.getSettings(context); });

$SD.onDidReceiveSettings('de.nas-max.test.action', (jsn) => { console.log(jsn); });

So, how can I get the settings in the inspector.js, or how can I send a JSON element (in this context the settings) from app.js to inspector.js?

ChekTek commented 5 months ago

Hi @developer-47, as this is not really an issue with the template, it may be better to ask questions in our GitHub Discussions forum where the community can help.

To answer your question, you can take a look at the example property inspector code provided in the template: https://github.com/elgatosf/streamdeck-plugin-template/blob/main/src/com.elgato.template.sdPlugin/actions/template/property-inspector/inspector.js

The property inspector receives a connected event from Stream Deck which will include previously saved settings.

Hope this helps!