-
Notifications
You must be signed in to change notification settings - Fork 1
/
homekit.html
77 lines (74 loc) · 3.08 KB
/
homekit.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
<script type="text/x-red" data-template-name="homekit-accessory-v2">
<div class="form-row">
<label for="node-config-input-pinCode"><i class="fa fa-lock"></i> Pin Code</label>
<input type="text" id="node-config-input-pinCode" placeholder="xxx-xx-xxx">
</div>
<div class="form-row">
<label for="node-config-input-port"><i class="fa fa-plug"></i> Port</label>
<input type="text" id="node-config-input-port" placeholder="Leave blank to auto assign">
</div>
<div class="form-row">
<label for="node-config-input-manufacturer"><i class="fa fa-wrench"></i> Manufacturer</label>
<input type="text" id="node-config-input-manufacturer" placeholder="Manufacturer">
</div>
<div class="form-row">
<label for="node-config-input-serialNo"><i class="fa fa-wrench"></i> Serial Number</label>
<input type="text" id="node-config-input-serialNo" placeholder="Serial Number">
</div>
<div class="form-row">
<label for="node-config-input-model"><i class="fa fa-wrench"></i> Model</label>
<input type="text" id="node-config-input-model" placeholder="Model">
</div>
<div class="form-row">
<label for="node-config-input-accessoryName"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-config-input-accessoryName" placeholder="Name">
</div>
</script>
<script type="text/x-red" data-help-name="homekit-accessory-v2">
<h3 id="toc_4">Accessory</h3>
<p>The Accessory node is a configuration node, specifying the <em>device</em> that iOS sees. </p>
<ul>
<li><strong>Pin Code</strong>: Specify the Pin for the pairing process.</li>
<li><strong>Port</strong>: If you are behind a Firewall, you may want to specify a port. Otherwise leave empty.</li>
<li><strong>Manufacturer, Model, Serial Number</strong>: Can be anything you want.</li>
<li><strong>Name</strong>: If you intend to simulate a rocket, then why don't you call it <em>Rocket</em>.</li>
</ul>
<p><em>Bridged Accessories</em> are not supported at the moment.</p>
</script>
<script type="text/javascript">
RED.nodes.registerType('homekit-accessory-v2', {
category: 'config',
defaults: {
accessoryName: {
value: "",
required: true
},
pinCode: {
value: "111-11-111",
required: true,
validate: RED.validators.regex(/[0-9]{3}-[0-9]{2}-[0-9]{3}/)
},
port: {
//validate:RED.validators.number()
},
manufacturer: {
value: "Default Manufacturer",
required: true
},
model: {
value: "Default Model",
required: true
},
serialNo: {
value: "Default Serial Number",
required: true
}
},
label: function() {
return this.accessoryName || "Accessory";
},
labelStyle: function() {
return this.accessoryName ? "node_label_italic" : "";
}
});
</script>