Skip to content
Snippets Groups Projects
actions.js 790 B
Newer Older
  • Learn to ignore specific revisions
  • Tobias Ullerich's avatar
    Tobias Ullerich committed
    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 = {
    
                    self.sendToWebSocket('cart-action', payload)
    
    Tobias Ullerich's avatar
    Tobias Ullerich committed
    }