node-red-contrib-homekit-mqtt
Version:
Node-RED nodes to simulate Apple HomeKit devices
78 lines (74 loc) • 3.15 kB
HTML
<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>