-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfan.html
128 lines (119 loc) · 4.29 KB
/
fan.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
<script type="text/javascript">
RED.nodes.registerType('matterfan',{
category: 'Matter',
color: '#289db6',
icon: "font-awesome/fa-dot-circle-o ",
inputs:1,
outputs:1,
defaults: {
name: {value:""},
bridge: { value: "", type: "matterbridge", required: true },
passthrough: {value: true},
levelstep: {value: 1},
bat: {value : false},
topic: {}
},
label: function() {
return this.name||"Fan";
},
paletteLabel: "Fan"
});
</script>
<script type="text/x-red" data-template-name="matterfan">
<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-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="matterfan">
<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 0-100 or 0-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 0-100 or 0-254 depending on the configuration of the range property
</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.
</script>