-
Notifications
You must be signed in to change notification settings - Fork 2
/
lirc.html
80 lines (75 loc) · 2.72 KB
/
lirc.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<script type="text/x-red" data-template-name="lirc-controller">
<div class="form-row">
<label for="node-config-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-config-input-name" placeholder="Name">
</div>
</script>
<script type="text/x-red" data-template-name="lirc-out">
<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-controller"><i class="icon-bookmark"></i> Controller</label>
<input type="text" id="node-input-controller">
</div>
<div class="form-row">
<label for="node-input-device"><i class="icon-bookmark"></i> Device name</label>
<input type="text" id="node-input-device" placeholder="philips">
</div>
<div class="form-row">
<label for="node-input-output"><i class="icon-bookmark"></i> Output</label>
<input type="text" id="node-input-output" placeholder="1">
</div>
</script>
<script type="text/x-red" data-help-name="lirc-out">
<p>
Use this to <b>send</b> commands via an lirc daemon connected to a Lirc device.<br/>
<b>msg.payload</b> must be contain the name of the command
</p>
<p>
For example: <code>KEY_POWER</code>
</p>
<br/>
<p>
For example, let configs be:
<ul>
<li><code>Name</code> is <code>TV</code> - the name of the node</li>
<li><code>Device name</code> is <code>philips</code> - the device name in the file lircd.conf</li>
<li><code>Output</code> is <code>1</code> - the number of the transmitter for lirc - may be not supported</li>
</ul>
</p>
</script>
<script type="text/x-red" data-help-name="lirc-in">
<p>Use this to <b>inject</b> flows from Lirc device<br/>
</script>
<script type="text/javascript">
RED.nodes.registerType('lirc-controller', {
category: 'config',
defaults: {
name: {value: ""}
},
label: function () {
return (this.name || 'lirc-controller' );
}
});
</script>
<script type="text/javascript">
RED.nodes.registerType('lirc-out', {
category: 'output',
color: '#26b050',
defaults: {
name: {value: ""},
controller: {value: "", type: "lirc-controller"},
device: {value: "", required: true},
output: {value: "", required: true, validate: RED.validators.number()}
},
inputs: 1,
outputs: 0,
align: 'right',
icon: "bridge-dash.png",
label: function () {
return (this.name || this.device || "lirc");
}
});
</script>