-
Notifications
You must be signed in to change notification settings - Fork 0
/
yeelight-compat-hue-out.html
76 lines (71 loc) · 2.45 KB
/
yeelight-compat-hue-out.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
<script type="text/javascript">
RED.nodes.registerType('yeelight-compat-hue-out', {
category: 'lights',
color: '#E2D96E',
defaults: {
name: {
value: ''
},
server: {
value: '',
required: true,
type: 'yeelight-compat-hue-config'
},
},
inputs: 1,
outputs: 0,
icon: 'light.png',
label: function() {
var server = RED.nodes.node(this.server);
return this.name || server ? server.label().replace(/\s\(.+\)/, '') : 'yeelight';
},
paletteLabel: 'yeelight',
align: 'right',
});
</script>
<script type="text/x-red"
data-template-name="yeelight-compat-hue-out">
<div class="form-row">
<label for="node-input-server"><i class="icon-tag"></i> Yeelight</label>
<input type="text" id="node-input-server" />
</div>
<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>
</script>
<script type="text/x-red"
data-help-name="yeelight-compat-hue-out">
<p>Sets the state of the selected Yeelight device, largely <a href="https://github.com/jdomeij/node-red-contrib-node-hue#readme">compatible with node-red-contrib-node-hue</a>.</p>
<h3>Inputs</h3>
<dl class="message-properties">
<dt>payload <span class="property-type">object</span></dt>
<dd>an object containing the next state of the selected Yeelight device.</dd>
</dl>
<h3>Details</h3>
<p>The node supports sending hex values, HSV values and color temperature values.</p>
<p>The brightness value will always have to be provided separately and will not be deducted from e.g. a hex value's brightness component.</p>
<h4>Example inputs</h4>
<p>
<pre><code>{
"on": true,
"bri": 255,
"hue": 913,
"sat": 255,
"duration": 5000
}</code></pre>
<pre><code>{
"on": true,
"bri": 120,
"hex": "#AA00CC"
}</code></pre>
<pre><code>{
"on": true,
"ct": 2200
}</code></pre>
</p>
<h3>References</h3>
<p>This node's input is based on <a href="https://github.com/jdomeij/node-red-contrib-node-hue#readme">node-red-contrib-node-hue</a>, which is based on <a href="https://github.com/peter-murray/node-hue-api#lightstate-options">Node Hue API</a>.</p>
</script>