Replies: 1 comment
-
Hi @jrdn91 The component library is still very much a work in progress! Here is a quick sample of how to send a message to the plugin on button press. You'll want to be sure you are on the latest version of the SDK as a few things have changed. Action Class @action({ UUID: 'com.elgato.test-send-to-plugin.increment' })
export class IncrementCounter extends SingletonAction<CounterSettings> {
override onSendToPlugin(ev: SendToPluginEvent<object, CounterSettings>): Promise<void> | void {
streamDeck.logger.info('Received a message from the plugin', ev.payload);
}
... UI HTML File <!DOCTYPE html>
<html>
<head lang="en">
<title>Increment Counter Settings</title>
<meta charset="utf-8" />
<script src="https://cdn.jsdelivr.net/gh/geekyeggo/sdpi-components@v3/dist/sdpi-components.js"></script>
</head>
<body>
<sdpi-item>
<sdpi-button onclick="SDPIComponents.streamDeckClient.send('sendToPlugin', {settings: 'my cool settings'});">
Click me
</sdpi-button>
</sdpi-item>
</body>
</html> The Hope this helps! |
Beta Was this translation helpful? Give feedback.
0 replies
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
-
I'm having trouble figuring out how I can trigger the
sendToPlugin
with an event from a SDPI button in the Property Inspector. It looks like these PI components are new so it seems this might be why I can't really find much information on them. Can anyone help me out? I simple want to have a button component send an event tosendToPlugin
so I can run a function to update some settings.Beta Was this translation helpful? Give feedback.
All reactions