UNPKG

node-red-contrib-alexa-remote2-applestrudel

Version:
89 lines (85 loc) 3.44 kB
<script type="text/x-red" data-template-name="alexa-remote-event"> <div class="form-row"> <label for="node-input-name"><i class="icon-tag"></i> Name</label> <input type="text" id="node-input-name" placeholder="Optional"> </div> <div class="form-row"> <label for="node-input-account"><i class="fa fa-amazon"></i> Account</label> <input id="node-input-account"> </div> <div class="form-row"> <label for="node-input-event"><i class="fa fa-sort"></i> Command</label> <select id="node-input-event" style="width: 70%"> <option value="ws-disconnect" >Disconnect </option> <option value="ws-error" >Error </option> <option value="ws-connect" >Connect </option> <option value="ws-unknown-message" >Unknown Message </option> <option value="ws-device-connection-change" >Device Connection Change </option> <option value="ws-bluetooth-state-change" >Bluetooth State Change </option> <option value="ws-audio-player-state-change">Audioplayer State Change </option> <option value="ws-media-queue-change" >Media Queue Change </option> <option value="ws-media-change" >Media Change </option> <option value="ws-media-progress-change" >Media Progress Change </option> <option value="ws-volume-change" >Volume Change </option> <option value="ws-content-focus-change" >Content Focus Change </option> <option value="ws-equilizer-state-change" >Equalizer State Change </option> <option value="ws-notification-change" >Notification Change </option> <option value="ws-device-activity" >Device Activity </option> <option value="ws-todo-change" >Todo List Change </option> <option value="ws-unknown-command" >Unknown Command </option> <option value="command" >All Events (raw data) </option> </select> </div> </script> <script type="text/x-red" data-help-name="alexa-remote-event"> <style> table, th, td { border-collapse: collapse; border: 1px solid rgb(204, 204, 204); padding: 4px 8px; } </style> <p>Listens to Push events. Events must be enabled for this account.</p> <hr> <h3><strong>Outputs</strong></h3> <ul> <li><strong>payload</strong> <ul> <li>the event payload</li> </ul> </li> </ul> <hr> <h3><strong>References</strong></h3> <ul> <li><a href="https://npmjs.com/package/node-red-contrib-alexa-remote2">npm</a> - the nodes npm repository</li> <li><a href="https://github.com/586837r/node-red-contrib-alexa-remote2">GitHub</a> - the nodes GitHub repository </li> </ul> </script> <script type="text/javascript"> RED.nodes.registerType('alexa-remote-event', { category: 'alexa', color: '#6fbad8', defaults: { name: { value: '' }, account: { value: '', type: 'alexa-remote-account', required: true }, event: { value: 'ws-device-activity', required: true } }, inputs: 0, outputs: 1, icon: 'alexa-remote-icon.png', paletteLabel: 'Alexa Event', label: function () { if (this.name) return this.name; if (this.event == 'command') return 'On any event (raw data)'; const match = this.event.slice(3).match(/(?:[A-Z]?[a-z]+)|[A-Z]|[0-9]+/g); var str = match.map(s => s.slice(0, 1).toUpperCase() + s.slice(1)).join(' '); return `On ${str}`; }, labelStyle: function () { return this.name ? "node_label_italic" : ""; } }); </script>