-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcolortemplight.html
155 lines (145 loc) · 5.33 KB
/
colortemplight.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<script type="text/javascript">
RED.nodes.registerType('mattercolortemplight',{
category: 'Matter',
color: '#6699ff',
icon: "font-awesome/fa-lightbulb-o",
inputs:1,
outputs:1,
defaults: {
name: {value:""},
bridge: { value: "", type: "matterbridge", required: true },
range: {value: "254"},
passthrough: {value: true},
tempformat: {value: "kelvin"},
levelstep: {value: 1},
bat: {value : false},
topic : {}
},
label: function() {
return this.name||"Color Temp Light";
},
paletteLabel: "Color Temp Light"
});
</script>
<script type="text/x-red" data-template-name="mattercolortemplight">
<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-config-input-bridge">Bridge</label>
<input type="text" id="node-input-bridge" style="width:70%;">
</div>
<div class="form-row">
<label for="node-input-passthrough">Passthrough Input msg to Output</label>
<select type="text" id="node-input-passthrough" style="width:50%;" >
<option value=true>True</option>
<option value=false>False</option>
</select>
</div>
<div class="form-row">
<label for="node-input-range">Range</label>
<select type="text" id="node-input-range" style="width:50%;" >
<option value="100">1-100</option>
<option value="254">1-254</option>
</select>
</div>
<div class="form-row">
<label for="node-input-tempformat">Color Temperature Units</label>
<select type="text" id="node-input-tempformat" style="width:50%;" >
<option value="kelvin">Kelvin</option>
<option value="mired">Mired</option>
</select>
</div>
<div class="form-row">
<label for="node-input-levelstep">Value for Level Step Change</label>
<input type="text" id="node-input-levelstep" placeholder="1">
</div>
<div class="form-row">
<label for="node-input-bat">Battery</label>
<select type="text" id="node-input-bat" style="width:50%;" >
<option value=false>None</option>
<option value="recharge">Rechargeable</option>
<option value="replace">Replaceable</option>
</select>
</div>
<div class="form-row">
<label for="node-input-topic">Topic</label>
<input type="text" id="node-input-topic" placeholder="Topic for new msgs">
</div>
</script>
<script type="text/x-red" data-help-name="mattercolortemplight">
<p>A Bridged Dimmable light</p>
<h3>Inputs</h3>
<dl class="message-properties">
<dt class="optional">
payload.state
<span class="property-type">
string | bool | number
</span>
</dt>
<dd>
Control the state of the light, accepts either true/fase, "on/off" or "0/1",<br>
You can also toggle the state by setting the value to "toggle"
</dd>
<dt class="optional">
payload.level
<span class="property-type">
number
</span>
</dt>
<dd>
Control the level of the light,<br>
either 1-100 or 1-254 depending on the configuration of the range property
</dd>
<dt class="optional">
payload.increaseLevel
</dt>
<dd>
If set this will increase the level by the value defined in the Level Step config
</dd>
<dt class="optional">
payload.decreaseLevel
</dt>
<dd>
If set this will decrease the level by the value defined in the Level Step config
</dd>
</dl>
<h3>Outputs</h3>
<dl class="message-properties">
<dt>
payload.state
<span class="property-type">
bool
</span>
</dt>
<dd>
State of the light, on is true, off is false
</dd>
<dt class="optional">
payload.level
<span class="property-type">
number
</span>
</dt>
<dd>
The level of the light,<br>
either 1-100 or 1-254 depending on the configuration of the range property
</dd>
<dt class="optional">
payload.temp
<span class="property-type">
number
</span>
</dt>
<dd>
The color temperature
</dd>
</dl>
<h3>Details</h3>
Passthrough will control the behaviour of the node in regards to an input,
if set to True then the inout msg wil be output with the new state in the payload.
If set to False then the output will be suppressed.
Where the devices state is updated by an external matter controller a new msg object will always be output.
Color Temperature Units can be set to Kelvin or Mireds, the same scale will be used for both input and output
</script>