Select Git revision
-
Tobias Ullerich authored
#187 - Find pad id by user provided name, receive pad name updates, cache pads by name in project model for fast access
Tobias Ullerich authored#187 - Find pad id by user provided name, receive pad name updates, cache pads by name in project model for fast access
actions.js 790 B
module.exports = function (self) {
self.setActionDefinitions({
sample_action: {
name: 'Trigger Pad',
options: [
{
id: 'name',
type: 'textinput',
label: 'Pad Name',
default: '',
},
],
callback: async (event) => {
const pad = self.currentProject.findPadByName(event.options.name);
if (!pad) {
self.log('warning', 'Cannot find a pad with name ' + event.options.name);
}
const payload = {
'pad': pad.id
};
self.sendToWebSocket('cart-action', payload)
},
},
})
}