-
Notifications
You must be signed in to change notification settings - Fork 3
/
check_mqtt_connection.html
70 lines (64 loc) · 2.64 KB
/
check_mqtt_connection.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
<script type="text/javascript">
RED.nodes.registerType('mqtt-check', {
category: 'network',
color: '#84fb96',
defaults: {
host: { value: "" },
port: { value: "" },
username: { value: "" },
password: { value: "" },
name: { value: "" },
},
inputs: 1,
outputs: 1,
icon: "conn.svg",
label: function () {
return this.name || "check mqtt conn";
}
});
</script>
<script type="text/html" data-template-name="mqtt-check">
<div class="form-row">
<label for="node-input-host"><i class="icon-tag"></i> Host</label>
<input type="text" id="node-input-host" placeholder="Host">
</div>
<div class="form-row">
<label for="node-input-port"><i class="icon-tag"></i> Port</label>
<input type="number" id="node-input-port" placeholder="Port">
</div>
<div class="form-row">
<label for="node-input-username"><i class="icon-tag"></i> Username</label>
<input type="text" id="node-input-username" placeholder="Optional username">
</div>
<div class="form-row">
<label for="node-input-password"><i class="icon-tag"></i> Password</label>
<input type="password" id="node-input-password" placeholder="Optional password">
</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/html" data-help-name="mqtt-check">
<p>A simple node that checks the connectivity with an MQTT broker.</p>
<h3>Inputs</h3>
<dl class="message-properties">
<dt>payload</dt>
<dd>The payload won't be used by the node. The same payload that gets in will get out.</dd>
</dl>
<h3>Outputs</h3>
<ol class="node-ports">
<li>Standard output
<dl class="message-properties">
<dt>mqttCheck <span class="property-type">object</span></dt>
<dd>An object that contains the result of the check</dd>
<dt>mqttCheck.connected <span class="property-type">boolean</span></dt>
<dd>True if the node connected successfully to the broker, false otherwise.</dd>
<dt>mqttCheck.code <span class="property-type">number</span></dt>
<dd>If available, it shows the returned code that indicates the connection status. <i>e.g.</i> 0 for success, 5 for unauthorized.</dd>
<dt>payload</dt>
<dd>The same payload that gets in will get out.</dd>
</dl>
</li>
</ol>
</script>