diff --git a/actions.js b/actions.js index 02265344595297496f216100260165e453c1a153..df48d56a1a74e9718bb21de6f01f9ed586899e2c 100644 --- a/actions.js +++ b/actions.js @@ -1,20 +1,28 @@ module.exports = function (self) { - self.setActionDefinitions({ - sample_action: { - name: 'Trigger Pad', - options: [ - { - id: 'num', - type: 'number', - label: 'Test', - default: 5, - min: 0, - max: 100, - }, - ], - callback: async (event) => { - console.log('Hello world!', event.options.num) - }, - }, - }) + self.setActionDefinitions({ + sample_action: { + name: 'Trigger Pad', + options: [ + { + id: 'num', + type: 'number', + label: 'Test', + default: 5, + min: 0, + max: 100, + }, + ], + callback: async (event) => { + const payload = { + 'messageId': 'id', + 'type': 'pad-status-change', + 'payload': { + 'pad': '8b7ef494-d735-45f9-ab84-c95e299298a6', + 'status': 'PLAY' + } + }; + self.ws.send(JSON.stringify(payload)) + }, + }, + }) }