|
1 |
| - |
2 | 1 | <script type="text/x-red" data-template-name="blink1">
|
| 2 | + <div class="form-row"> |
| 3 | + <label for="node-input-name"><i class="fa fa-tag"></i> Name</label> |
| 4 | + <input type="text" id="node-input-name" placeholder="Name"> |
| 5 | + </div> |
3 | 6 | <div class="form-row">
|
4 | 7 | <label for="node-input-serial"><i class="fa fa-random"></i> Device ID</label>
|
5 | 8 | <input type="text" id="node-input-serial" placeholder="defaults to first found" style="width:60%">
|
|
9 | 12 | <label for="node-input-fade"><i class="fa fa-signal"></i> Fade (mS)</label>
|
10 | 13 | <input type="text" id="node-input-fade" placeholder="between 0 and 60,000 mS (1 min)">
|
11 | 14 | </div>
|
12 |
| - <div class="form-row"> |
13 |
| - <label for="node-input-name"><i class="fa fa-tag"></i> Name</label> |
14 |
| - <input type="text" id="node-input-name" placeholder="Name"> |
15 |
| - </div> |
16 | 15 | </script>
|
17 | 16 |
|
18 | 17 | <script type="text/x-red" data-help-name="blink1">
|
|
26 | 25 |
|
27 | 26 | <script type="text/javascript">
|
28 | 27 | RED.nodes.registerType('blink1',{
|
29 |
| - category: 'output', |
| 28 | + category: "blink1", |
30 | 29 | color:"GoldenRod",
|
| 30 | + paletteLabel: "blink1 out", |
31 | 31 | defaults: {
|
32 | 32 | serial: {value:""},
|
33 | 33 | fade: {value:"500",required:true,validate:RED.validators.number()},
|
|
38 | 38 | icon: "light.png",
|
39 | 39 | align: "right",
|
40 | 40 | label: function() {
|
41 |
| - return this.name||"blink1"; |
| 41 | + return this.name||"blink1 out"; |
| 42 | + }, |
| 43 | + labelStyle: function() { |
| 44 | + return this.name?"node_label_italic":""; |
| 45 | + }, |
| 46 | + oneditprepare: function() { |
| 47 | + $("#node-lookup-serial").click(function() { |
| 48 | + $.getJSON('blink1list',function(data) { |
| 49 | + $("#node-input-serial").autocomplete({ |
| 50 | + source:data, |
| 51 | + minLength:0, |
| 52 | + close: function( event, ui ) { |
| 53 | + $("#node-input-serial").autocomplete( "destroy" ); |
| 54 | + } |
| 55 | + }).autocomplete("search",""); |
| 56 | + }); |
| 57 | + }); |
| 58 | + } |
| 59 | + }); |
| 60 | +</script> |
| 61 | + |
| 62 | +<script type="text/x-red" data-template-name="blink1 in"> |
| 63 | + <div class="form-row"> |
| 64 | + <label for="node-input-name"><i class="fa fa-tag"></i> Name</label> |
| 65 | + <input type="text" id="node-input-name" placeholder="Name"> |
| 66 | + </div> |
| 67 | + <div class="form-row"> |
| 68 | + <label for="node-input-serial"><i class="fa fa-random"></i> Device ID</label> |
| 69 | + <input type="text" id="node-input-serial" placeholder="defaults to first found" style="width:60%"> |
| 70 | + <a id="node-lookup-serial" class="btn"><i id="node-lookup-serial-icon" class="fa fa-search"></i></a> |
| 71 | + </div> |
| 72 | +</script> |
| 73 | + |
| 74 | +<script type="text/x-red" data-help-name="blink1 in"> |
| 75 | + <p>ThingM Blink1 input node.</p> |
| 76 | + <p>Outputs the current RGB value as array <code>[r,g,b]</code> or "off" as string if RGB is 0,0,0 to <code>msg.payload</code>.</p> |
| 77 | +</script> |
| 78 | + |
| 79 | +<script type="text/javascript"> |
| 80 | + RED.nodes.registerType('blink1 in',{ |
| 81 | + category: 'blink1', |
| 82 | + color:"GoldenRod", |
| 83 | + paletteLabel:"blink1 in", |
| 84 | + defaults: { |
| 85 | + serial: {value:""} |
| 86 | + }, |
| 87 | + inputs:1, |
| 88 | + outputs:1, |
| 89 | + icon: "light.png", |
| 90 | + align: "left", |
| 91 | + label: function() { |
| 92 | + return this.name||"blink1 in"; |
42 | 93 | },
|
43 | 94 | labelStyle: function() {
|
44 | 95 | return this.name?"node_label_italic":"";
|
|
0 commit comments