From 95b9571d4cb1dba22d8812b5e657a976be8a13f8 Mon Sep 17 00:00:00 2001 From: tobias <thinkdifferent055@gmail.com> Date: Mon, 18 Sep 2023 22:01:51 +0200 Subject: [PATCH] Send first command to playwall --- actions.js | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/actions.js b/actions.js index 0226534..df48d56 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)) + }, + }, + }) } -- GitLab