Getting the value of Ticks upon receiving a dialRotate Event #26
Replies: 1 comment
-
Hi! So it looks like this plugin does not use the Elgato Javascript SDK, instead it is using a different class from stream-deck.js in the plugin. In order to build dial actions for this plugin, you would have to expand this class to listen for dial events from Stream Deck. You might be able to use the The template plugin found here does have an example of just logging to the console when a dial event comes through to an action, but unfortunately I'm not sure it would be all that helpful with the Sonos plugin, since the template uses the Elgato Javascript SDK. |
Beta Was this translation helpful? Give feedback.
-
I am attempting to extend the existing Stream Deck Sonos plug-in to support the Stream Deck+ by adding a new action.
The existing source code for the plug-in is available on GitHub here:
https://github.com/GenericMale/streamdeck-sonos
I am struggling to get the new action to work since it appears the ticks associated with dialRotate event are not available to the new action I have written. The code is below:
define(class extends SonosAction {
async onDialDown({payload: {state}}) {
return state === 0 ?
this.sonos.setMute(1) :
this.sonos.setMute(0);
}
async onDialRotate({payload: {settings, ticks}}) {
const {CurrentVolume: volume} = await this.sonos.getVolume();
return this.sonos.setvolume(parseInt(volume) + parseInt(ticks));
}
});
Trying to use the plug-in generates the following unhandled error:
stream-deck.js:415 Uncaught TypeError: this.streamDeck.en is not a function
at new Action (stream-deck.js:415:25)
at new SonosAction (index.js:48:1)
at new <anonymous> (adjustvolume.js:1:8)
at window.define (index.js:40:27)
at adjustvolume.js:1:1
Is there a fully formed example or sample showing how the dialRotate event should be handled and the ticks value associated with the event read?
Beta Was this translation helpful? Give feedback.
All reactions