UNPKG

node-red-contrib-wio-seeed

Version:
80 lines (78 loc) 2.58 kB
<script type="text/javascript"> RED.nodes.registerType('wio-ws2812', { paletteLabel: 'ws2812', category: 'wio', color: '#C0EDC0', defaults: { name: { value: '' }, connection: { type: 'wio-config' }, node: { value: '' }, port: { value: '' }, mode: { value: 'auto' }, pos: { value: 0 }, count: { value: 30 }, colors: { value: 'FF0000,EE1100,DD2200,CC3300,BB4400,AA5500,996600,887700,778800,669900,55AA00,44BB00,32CC00,21DD00,10EE00' + ',00FF00,00EC12,00DA24,00C836,00B648,00A35B,00916D,007F7F,006D91,005BA3,0048B6,0036C8,0024DA,0012EC,0000FF' } }, inputs: 1, outputs: 1, icon: 'subflow.png', label: function () { return this.name || 'ws2812'; }, oneditprepare: function () { var config = this; var skus = { '104990089': { name: 'Grove LED WS2812', module: 'GroveLedWs2812' } }; $.getScript('wio-common').done(function (res) { WioCommon(config, skus); }); } }); </script> <script type="text/x-red" data-template-name="wio-ws2812"> <div class="form-row"> <label for="node-input-name"><i class="icon-tag"></i> Name</label> <input type="text" id="node-input-name" placeholder="Name"> </div> <div class="form-row"> <label for="node-input-connection"><i class="icon-tag"></i> Connection</label> <select type="text" id="node-input-connection"></select> </div> <div class="form-row"> <label for="node-input-node"><i class="icon-tag"></i> Node</label> <select type="text" id="node-input-node"></select> </div> <div class="form-row"> <label for="node-input-port"><i class="icon-tag"></i> Port</label> <select type="text" id="node-input-port"></select> </div> <div class="form-row"> <label for="node-input-mode"><i class="icon-tag"></i> Mode</label> <select type="text" id="node-input-mode"> <option value="auto">Auto</option> <option value="manual">Manual</option> </select> </div> <div class="form-row"> <label for="node-input-pos"><i class="icon-tag"></i> Pos</label> <input type="text" id="node-input-pos" placeholder="Pos"> </div> <div class="form-row"> <label for="node-input-count"><i class="icon-tag"></i> Count</label> <input type="text" id="node-input-count" placeholder="Count"> </div> <div class="form-row"> <label for="node-input-colors"><i class="icon-tag"></i> Colors</label> <input type="text" id="node-input-colors" placeholder="Colors"> </div> </script> <script type="text/x-red" data-help-name="wio-ws2812"> <p>Wio WS2812</p> </script>