node-red-contrib-homekit-bridged 2.0.0-dev.5 → 2.0.0-dev.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lib/HAPHostNode.js +183 -141
- package/build/lib/HAPServiceNode.js +199 -172
- package/build/lib/HAPServiceNode2.js +207 -172
- package/build/lib/NRCHKBError.js +23 -2
- package/build/lib/PairingQRCode.js +62 -0
- package/build/lib/Storage.js +157 -92
- package/build/lib/api.js +654 -288
- package/build/lib/camera/CameraControl.js +119 -84
- package/build/lib/camera/CameraDelegate.js +481 -404
- package/build/lib/camera/MP4StreamingServer.js +148 -139
- package/build/lib/hap/HAPCharacteristic.js +25 -4
- package/build/lib/hap/HAPService.js +25 -4
- package/build/lib/hap/eve-app/EveCharacteristics.js +124 -81
- package/build/lib/hap/eve-app/EveServices.js +50 -17
- package/build/lib/hap/hap-nodejs.js +32 -0
- package/build/lib/migration/HomeKitService2Migration.js +34 -0
- package/build/lib/migration/NodeMigration.js +75 -0
- package/build/lib/types/AccessoryInformationType.js +15 -1
- package/build/lib/types/CameraConfigType.js +15 -1
- package/build/lib/types/CustomCharacteristicType.js +15 -1
- package/build/lib/types/HAPHostConfigType.js +15 -1
- package/build/lib/types/HAPHostNodeType.js +15 -1
- package/build/lib/types/HAPService2ConfigType.js +15 -1
- package/build/lib/types/HAPService2NodeType.js +15 -1
- package/build/lib/types/HAPServiceConfigType.js +15 -1
- package/build/lib/types/HAPServiceNodeType.js +15 -1
- package/build/lib/types/HAPStatusConfigType.js +15 -1
- package/build/lib/types/HAPStatusNodeType.js +15 -1
- package/build/lib/types/HostType.js +28 -7
- package/build/lib/types/NodeType.js +15 -1
- package/build/lib/types/PublishTimersType.js +15 -1
- package/build/lib/types/UniFiControllerConfigType.js +16 -0
- package/build/lib/types/hap-nodejs/HapAdaptiveLightingControllerMode.js +28 -7
- package/build/lib/types/hap-nodejs/HapCategories.js +64 -43
- package/build/lib/types/storage/SerializedHostType.js +15 -1
- package/build/lib/types/storage/StorageType.js +34 -10
- package/build/lib/unifi/ProtectDiscovery.js +80 -0
- package/build/lib/utils/AccessoryUtils.js +152 -110
- package/build/lib/utils/BridgeUtils.js +82 -39
- package/build/lib/utils/CharacteristicUtils.js +5 -49
- package/build/lib/utils/CharacteristicUtils2.js +5 -49
- package/build/lib/utils/CharacteristicUtilsBase.js +81 -0
- package/build/lib/utils/NodeStatusUtils.js +89 -40
- package/build/lib/utils/ServiceUtils.js +434 -375
- package/build/lib/utils/ServiceUtils2.js +514 -309
- package/build/lib/utils/index.js +10 -11
- package/build/nodes/bridge.html +184 -166
- package/build/nodes/bridge.js +27 -9
- package/build/nodes/locales/en-US/node-red-contrib-homekit-bridged.json +22 -0
- package/build/nodes/nrchkb.html +1601 -88
- package/build/nodes/nrchkb.js +66 -88
- package/build/nodes/plugin-instance.html +499 -0
- package/build/nodes/plugin-instance.js +46 -0
- package/build/nodes/service.html +517 -299
- package/build/nodes/service.js +5 -6
- package/build/nodes/service2.html +1683 -460
- package/build/nodes/service2.js +5 -8
- package/build/nodes/standalone.html +187 -174
- package/build/nodes/standalone.js +27 -9
- package/build/nodes/status.html +51 -18
- package/build/nodes/status.js +47 -40
- package/build/nodes/unifi-controller.html +92 -0
- package/build/nodes/unifi-controller.js +20 -0
- package/build/plugins/embedded/homebridge-camera-ffmpeg/index.js +479 -0
- package/build/plugins/embedded/homebridge-unifi-protect/index.js +521 -0
- package/build/plugins/embedded/index.js +58 -0
- package/build/plugins/nrchkb-homekit-plugins.js +17 -0
- package/build/plugins/registry/index.js +203 -0
- package/build/plugins/registry/types.js +16 -0
- package/build/scripts/migrate-homekit-service-flows.js +47 -0
- package/examples/demo/01 - ALL Demos single import.json +1885 -1885
- package/examples/demo/02 - Air Purifier.json +279 -279
- package/examples/demo/03 - Air Quality sensor with Battery.json +254 -254
- package/examples/demo/04 - Dimmable Bulb.json +172 -172
- package/examples/demo/05 - Color Bulb (HSV).json +195 -195
- package/examples/demo/06 - Fan (simple, 3 speeds).json +240 -240
- package/examples/demo/07 - Fan (with speed, oscillate, rotation direction).json +175 -175
- package/examples/demo/08 - CO2 detector.json +224 -224
- package/examples/demo/09 - CO (carbon monoxide) example.json +255 -255
- package/examples/demo/10 - Door window contact sensor.json +234 -234
- package/examples/demos (advanced)/01 - Television with inputs and speaker.json +541 -541
- package/examples/switch/01 - Plain Switch.json +178 -178
- package/package.json +95 -84
- package/build/lib/HAPHostNode.d.ts +0 -1
- package/build/lib/HAPServiceNode.d.ts +0 -1
- package/build/lib/HAPServiceNode2.d.ts +0 -1
- package/build/lib/NRCHKBError.d.ts +0 -3
- package/build/lib/Storage.d.ts +0 -30
- package/build/lib/api.d.ts +0 -1
- package/build/lib/camera/CameraControl.d.ts +0 -3
- package/build/lib/camera/CameraDelegate.d.ts +0 -38
- package/build/lib/camera/MP4StreamingServer.d.ts +0 -26
- package/build/lib/hap/HAPCharacteristic.d.ts +0 -9
- package/build/lib/hap/HAPService.d.ts +0 -6
- package/build/lib/hap/eve-app/EveCharacteristics.d.ts +0 -20
- package/build/lib/hap/eve-app/EveServices.d.ts +0 -5
- package/build/lib/types/AccessoryInformationType.d.ts +0 -11
- package/build/lib/types/CameraConfigType.d.ts +0 -24
- package/build/lib/types/CustomCharacteristicType.d.ts +0 -6
- package/build/lib/types/HAPHostConfigType.d.ts +0 -22
- package/build/lib/types/HAPHostNodeType.d.ts +0 -14
- package/build/lib/types/HAPService2ConfigType.d.ts +0 -6
- package/build/lib/types/HAPService2NodeType.d.ts +0 -7
- package/build/lib/types/HAPServiceConfigType.d.ts +0 -26
- package/build/lib/types/HAPServiceNodeType.d.ts +0 -38
- package/build/lib/types/HAPStatusConfigType.d.ts +0 -5
- package/build/lib/types/HAPStatusNodeType.d.ts +0 -12
- package/build/lib/types/HostType.d.ts +0 -5
- package/build/lib/types/NodeType.d.ts +0 -3
- package/build/lib/types/PublishTimersType.d.ts +0 -4
- package/build/lib/types/hap-nodejs/HapAdaptiveLightingControllerMode.d.ts +0 -5
- package/build/lib/types/hap-nodejs/HapCategories.d.ts +0 -41
- package/build/lib/types/storage/SerializedHostType.d.ts +0 -5
- package/build/lib/types/storage/StorageType.d.ts +0 -8
- package/build/lib/utils/AccessoryUtils.d.ts +0 -1
- package/build/lib/utils/BridgeUtils.d.ts +0 -1
- package/build/lib/utils/CharacteristicUtils.d.ts +0 -1
- package/build/lib/utils/CharacteristicUtils2.d.ts +0 -1
- package/build/lib/utils/NodeStatusUtils.d.ts +0 -17
- package/build/lib/utils/ServiceUtils.d.ts +0 -1
- package/build/lib/utils/ServiceUtils2.d.ts +0 -1
- package/build/lib/utils/index.d.ts +0 -1
- package/build/nodes/bridge.d.ts +0 -1
- package/build/nodes/nrchkb.d.ts +0 -1
- package/build/nodes/service.d.ts +0 -1
- package/build/nodes/service2.d.ts +0 -1
- package/build/nodes/standalone.d.ts +0 -1
- package/build/nodes/status.d.ts +0 -1
package/build/lib/utils/index.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
2
|
module.exports = (node) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
const ServiceUtils = require("./ServiceUtils")(node);
|
|
4
|
+
const BridgeUtils = require("./BridgeUtils")();
|
|
5
|
+
const AccessoryUtils = require("./AccessoryUtils")(node);
|
|
6
|
+
const CharacteristicUtils = require("./CharacteristicUtils")(node);
|
|
7
|
+
return {
|
|
8
|
+
ServiceUtils,
|
|
9
|
+
BridgeUtils,
|
|
10
|
+
AccessoryUtils,
|
|
11
|
+
CharacteristicUtils
|
|
12
|
+
};
|
|
14
13
|
};
|
package/build/nodes/bridge.html
CHANGED
|
@@ -1,183 +1,186 @@
|
|
|
1
1
|
<script data-template-name="homekit-bridge" type="text/x-red">
|
|
2
|
-
<div class="
|
|
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
|
-
<input type="checkbox" id="node-config-input-mdnsReuseAddr" checked>
|
|
95
|
-
</div>
|
|
96
|
-
</div>
|
|
97
|
-
<hr>
|
|
2
|
+
<div class="nrchkb-editor">
|
|
3
|
+
<details class="nrchkb-section" open>
|
|
4
|
+
<summary><i class="fa fa-key"></i> Pairing</summary>
|
|
5
|
+
<div class="nrchkb-section-body">
|
|
6
|
+
<div class="form-row">
|
|
7
|
+
<label for="node-config-input-bridgeName"><i class="fa fa-home"></i> Name</label>
|
|
8
|
+
<input type="text" id="node-config-input-bridgeName" placeholder="Name">
|
|
9
|
+
</div>
|
|
10
|
+
<div class="form-row">
|
|
11
|
+
<label for="node-config-input-pinCode"><i class="fa fa-key"></i> Pin Code</label>
|
|
12
|
+
<input type="text" id="node-config-input-pinCode" placeholder="xxxx-xxxx">
|
|
13
|
+
</div>
|
|
14
|
+
<details class="nrchkb-section">
|
|
15
|
+
<summary><i class="fa fa-qrcode"></i> <span data-i18n="node-red-contrib-homekit-bridged/qr.sectionTitle">Pairing QR Code</span></summary>
|
|
16
|
+
<div class="nrchkb-section-body" id="nrchkb-bridge-pairing-qr">
|
|
17
|
+
<p class="nrchkb-pairing-message" data-i18n="node-red-contrib-homekit-bridged/qr.loading">Loading pairing state...</p>
|
|
18
|
+
</div>
|
|
19
|
+
</details>
|
|
20
|
+
<div class="form-row nrchkb-checkbox-row">
|
|
21
|
+
<label class="nrchkb-checkbox-label" for="node-config-input-allowInsecureRequest">
|
|
22
|
+
<input type="checkbox" id="node-config-input-allowInsecureRequest">
|
|
23
|
+
<span><i class="fa fa-unlock-alt"></i> Allow Insecure Request</span>
|
|
24
|
+
</label>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</details>
|
|
28
|
+
|
|
29
|
+
<details class="nrchkb-section" open>
|
|
30
|
+
<summary><i class="fa fa-wifi"></i> Network & Advertising</summary>
|
|
31
|
+
<div class="nrchkb-section-body">
|
|
32
|
+
<div class="form-row">
|
|
33
|
+
<label for="node-config-input-port"><i class="fa fa-plug"></i> Port</label>
|
|
34
|
+
<input type="text" id="node-config-input-port" placeholder="Leave blank to auto assign">
|
|
35
|
+
</div>
|
|
36
|
+
<div class="form-row">
|
|
37
|
+
<label for="node-config-input-advertiser"><i class="fa fa-bullhorn"></i> Advertiser</label>
|
|
38
|
+
<select id="node-config-input-advertiser">
|
|
39
|
+
<option value="bonjour-hap" selected="selected">BONJOUR</option>
|
|
40
|
+
<option value="ciao">CIAO</option>
|
|
41
|
+
<option value="avahi">AVAHI</option>
|
|
42
|
+
<option value="resolved">RESOLVED</option>
|
|
43
|
+
</select>
|
|
44
|
+
</div>
|
|
45
|
+
<div class="form-row">
|
|
46
|
+
<label for="node-config-input-bind"><i class="fa fa-sitemap"></i> Bind</label>
|
|
47
|
+
<input type="text" id="node-config-input-bind" placeholder="::">
|
|
48
|
+
<input type="hidden" id="node-config-input-bindType">
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</details>
|
|
52
|
+
|
|
53
|
+
<details class="nrchkb-section">
|
|
54
|
+
<summary><i class="fa fa-id-card-o"></i> Accessory Metadata</summary>
|
|
55
|
+
<div class="nrchkb-section-body">
|
|
56
|
+
<div class="form-row">
|
|
57
|
+
<label for="node-config-input-manufacturer"><i class="fa fa-industry"></i> Manufacturer</label>
|
|
58
|
+
<input type="text" id="node-config-input-manufacturer" placeholder="Manufacturer">
|
|
59
|
+
</div>
|
|
60
|
+
<div class="form-row">
|
|
61
|
+
<label for="node-config-input-serialNo"><i class="fa fa-barcode"></i> Serial Number</label>
|
|
62
|
+
<input type="text" id="node-config-input-serialNo" placeholder="Serial Number">
|
|
63
|
+
</div>
|
|
64
|
+
<div class="form-row">
|
|
65
|
+
<label for="node-config-input-model"><i class="fa fa-cube"></i> Model</label>
|
|
66
|
+
<input type="text" id="node-config-input-model" placeholder="Model">
|
|
67
|
+
</div>
|
|
68
|
+
<div class="form-row">
|
|
69
|
+
<label for="node-config-input-firmwareRev"><i class="fa fa-microchip"></i> Firmware Revision</label>
|
|
70
|
+
<input type="text" id="node-config-input-firmwareRev" placeholder="Firmware Revision">
|
|
71
|
+
</div>
|
|
72
|
+
<div class="form-row">
|
|
73
|
+
<label for="node-config-input-hardwareRev"><i class="fa fa-hdd-o"></i> Hardware Revision</label>
|
|
74
|
+
<input type="text" id="node-config-input-hardwareRev" placeholder="Hardware Revision">
|
|
75
|
+
</div>
|
|
76
|
+
<div class="form-row">
|
|
77
|
+
<label for="node-config-input-softwareRev"><i class="fa fa-code"></i> Software Revision</label>
|
|
78
|
+
<input type="text" id="node-config-input-softwareRev" placeholder="Software Revision">
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</details>
|
|
82
|
+
|
|
83
|
+
<details class="nrchkb-section">
|
|
84
|
+
<summary><i class="fa fa-exchange"></i> Message Handling</summary>
|
|
85
|
+
<div class="nrchkb-section-body">
|
|
86
|
+
<div class="form-row nrchkb-checkbox-row">
|
|
87
|
+
<label class="nrchkb-checkbox-label" for="node-config-input-allowMessagePassthrough">
|
|
88
|
+
<input type="checkbox" id="node-config-input-allowMessagePassthrough">
|
|
89
|
+
<span><i class="fa fa-share"></i> Allow Message Passthrough</span>
|
|
90
|
+
</label>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
</details>
|
|
98
94
|
|
|
95
|
+
<details class="nrchkb-section">
|
|
96
|
+
<summary><i class="fa fa-exclamation-triangle"></i> Deprecated mDNS</summary>
|
|
97
|
+
<div class="nrchkb-section-body">
|
|
98
|
+
<div class="form-row nrchkb-checkbox-row">
|
|
99
|
+
<label class="nrchkb-checkbox-label" for="node-config-input-customMdnsConfig">
|
|
100
|
+
<input type="checkbox" id="node-config-input-customMdnsConfig">
|
|
101
|
+
<span><i class="fa fa-exclamation-triangle"></i> Custom MDNS Configuration (DEPRECATED, use Bind)</span>
|
|
102
|
+
</label>
|
|
103
|
+
</div>
|
|
104
|
+
<div id="mdns-configuration" class="nrchkb-nested-panel" style="display: none;">
|
|
105
|
+
<div class="form-row nrchkb-checkbox-row">
|
|
106
|
+
<label class="nrchkb-checkbox-label" for="node-config-input-mdnsMulticast">
|
|
107
|
+
<input type="checkbox" id="node-config-input-mdnsMulticast" checked>
|
|
108
|
+
<span><i class="fa fa-share-alt"></i> Multicast</span>
|
|
109
|
+
</label>
|
|
110
|
+
</div>
|
|
111
|
+
<div class="form-row">
|
|
112
|
+
<label for="node-config-input-mdnsInterface"><i class="fa fa-sitemap"></i> Multicast Interface IP</label>
|
|
113
|
+
<input type="text" id="node-config-input-mdnsInterface" placeholder="">
|
|
114
|
+
</div>
|
|
115
|
+
<div class="form-row">
|
|
116
|
+
<label for="node-config-input-mdnsPort"><i class="fa fa-plug"></i> Port</label>
|
|
117
|
+
<input type="text" id="node-config-input-mdnsPort" placeholder="">
|
|
118
|
+
</div>
|
|
119
|
+
<div class="form-row">
|
|
120
|
+
<label for="node-config-input-mdnsIp"><i class="fa fa-map-marker"></i> Multicast Address IP</label>
|
|
121
|
+
<input type="text" id="node-config-input-mdnsIp" placeholder="">
|
|
122
|
+
</div>
|
|
123
|
+
<div class="form-row">
|
|
124
|
+
<label for="node-config-input-mdnsTtl"><i class="fa fa-clock-o"></i> TTL</label>
|
|
125
|
+
<input type="text" id="node-config-input-mdnsTtl" placeholder="255">
|
|
126
|
+
</div>
|
|
127
|
+
<div class="form-row nrchkb-checkbox-row">
|
|
128
|
+
<label class="nrchkb-checkbox-label" for="node-config-input-mdnsLoopback">
|
|
129
|
+
<input type="checkbox" id="node-config-input-mdnsLoopback" checked>
|
|
130
|
+
<span><i class="fa fa-refresh"></i> Loopback</span>
|
|
131
|
+
</label>
|
|
132
|
+
</div>
|
|
133
|
+
<div class="form-row nrchkb-checkbox-row">
|
|
134
|
+
<label class="nrchkb-checkbox-label" for="node-config-input-mdnsReuseAddr">
|
|
135
|
+
<input type="checkbox" id="node-config-input-mdnsReuseAddr" checked>
|
|
136
|
+
<span><i class="fa fa-recycle"></i> Reuse Address</span>
|
|
137
|
+
</label>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
</details>
|
|
142
|
+
</div>
|
|
99
143
|
</script>
|
|
100
144
|
|
|
101
|
-
<script data-help-name="homekit-bridge" type="text/
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
<li><strong>Advertiser</strong>: Which MDNS advertiser to use <em>ciao</em> (new, improved but not yet proved) or (good old) <em>bonjour</em> or experimental <em>avahi</em> and <em>resolved</em>. Default <em>bonjour</em>.</li>
|
|
109
|
-
<li><strong>Allow Insecure Request</strong>: Should we allow insecure request? Default false.</li>
|
|
110
|
-
<li><strong>Manufacturer, Model, Serial Number</strong>: Can be anything you want.</li>
|
|
111
|
-
<li><strong>Firmware Revision</strong>: Should be a version number string in the form of <em>MAJOR.MINOR.REVISION</em> e.g. <em>1.2.0</em>. Other types of strings are ignored and won't be displayed.</li>
|
|
112
|
-
<li><strong>Hardware Revision</strong>: Should be a version number string in the form of <em>MAJOR.MINOR.REVISION</em> e.g. <em>1.2.0</em>. Other types of strings are ignored and won't be displayed.</li>
|
|
113
|
-
<li><strong>Software Revision</strong>: Should be a version number string in the form of <em>MAJOR.MINOR.REVISION</em> e.g. <em>1.2.0</em>. Other types of strings are ignored and won't be displayed.</li>
|
|
114
|
-
<li><strong>Name</strong>: If you intend to simulate a rocket, then why don't you call it <em>Rocket</em>. Name should be maximum 64 chars long and not contain <pre>.</pre></li>
|
|
115
|
-
<li><strong>Allow Message Passthrough</strong>: If you allow then message from node input will be sent to node output.</li>
|
|
116
|
-
<li><strong>Bind</strong>: Defines the host where the HAP server will be bound to. </li>
|
|
117
|
-
<ul>
|
|
118
|
-
<li>
|
|
119
|
-
Defines the host where the HAP server will be bound to.
|
|
120
|
-
When undefined the HAP server will bind to all available interfaces
|
|
121
|
-
(see https://nodejs.org/api/net.html#net_server_listen_port_host_backlog_callback).
|
|
145
|
+
<script data-help-name="homekit-bridge" type="text/markdown">
|
|
146
|
+
# HomeKit Bridge
|
|
147
|
+
|
|
148
|
+
Defines the HomeKit bridge that users pair in the Apple Home app. Services assigned to this bridge are published behind one bridge, which keeps mDNS advertising lighter than publishing every service as a standalone accessory.
|
|
149
|
+
|
|
150
|
+
> [!IMPORTANT]
|
|
151
|
+
> Use a stable bridge name, PIN, serial number, and model. HomeKit treats those values as part of the accessory identity.
|
|
122
152
|
|
|
123
|
-
|
|
124
|
-
|
|
153
|
+
> [!WARNING]
|
|
154
|
+
> **Allow Insecure Request** permits unencrypted HomeKit requests. Leave it disabled unless a deliberate test client requires it.
|
|
125
155
|
|
|
126
|
-
|
|
127
|
-
in oder to bind on all address records (and ip version) available.
|
|
156
|
+
## Pairing
|
|
128
157
|
|
|
129
|
-
|
|
130
|
-
|
|
158
|
+
- **Name**: Bridge name shown during pairing. HomeKit names can be up to 64 characters and must not contain a period.
|
|
159
|
+
- **Pin Code**: HomeKit setup code used when pairing the bridge.
|
|
160
|
+
- **Pairing QR Code**: Shows after the bridge is deployed and only while the bridge is not paired.
|
|
131
161
|
|
|
132
|
-
|
|
133
|
-
- bind: "::"
|
|
134
|
-
Pretty much identical to not specifying anything, as most systems (with ipv6 support)
|
|
135
|
-
will default to the unspecified ipv6 address (with dual stack support).
|
|
162
|
+
## Network & Advertising
|
|
136
163
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
164
|
+
- **Port**: Optional HAP server port. Leave blank to auto-assign. Do not use `1880`, which is reserved for Node-RED.
|
|
165
|
+
- **Advertiser**: Selects the mDNS/DNS-SD backend used to announce this bridge to HomeKit.
|
|
166
|
+
- **Bind**: Restricts the network interfaces or IP addresses used by the HAP server and mDNS advertisement.
|
|
140
167
|
|
|
141
|
-
|
|
142
|
-
The mdns advertising will advertise all records of the en0 and loopback interface (if available) and
|
|
143
|
-
will also react to address changes on those interfaces.
|
|
144
|
-
In order for the HAP server to accept all those address records (which may contain ipv6 records)
|
|
145
|
-
it will bind on the unspecified ipv6 address "::" (assuming dual stack is supported).
|
|
168
|
+
<p class="nrchkb-advertiser-dynamic">Recommendation unavailable.</p>
|
|
146
169
|
|
|
147
|
-
|
|
148
|
-
Same as above, only that the HAP server will bind on the unspecified ipv4 address "0.0.0.0".
|
|
149
|
-
The mdns advertisement will not advertise any ipv6 records.
|
|
170
|
+
Advertiser guide:
|
|
150
171
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
the mdns advertisement will result in not advertising an address at all.
|
|
156
|
-
So it is advised to specify an interface name instead of a specific address.
|
|
157
|
-
This is identical with ipv6 addresses.
|
|
172
|
+
- **AVAHI**: Best first choice for Raspberry Pi OS, Debian, Ubuntu, Homebridge OS, and Linux servers where `avahi-daemon` and `dbus` are installed and running.
|
|
173
|
+
- **CIAO**: Best default for macOS, Windows, Docker Desktop, and Linux setups where Avahi is unavailable.
|
|
174
|
+
- **RESOLVED**: Advanced Linux-only option for hosts intentionally using `systemd-resolved` mDNS with working D-Bus permissions.
|
|
175
|
+
- **BONJOUR**: Legacy compatibility fallback.
|
|
158
176
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
the HAP server will bind to the unspecified ip address (0.0.0.0 if only ipv4 addresses are supplied,
|
|
162
|
-
:: if a mixture or only ipv6 addresses are supplied).
|
|
163
|
-
The mdns advertisement will only advertise the specified ip addresses.
|
|
164
|
-
If the given network interface of that address encounters an ip address change (to different addresses),
|
|
165
|
-
the mdns advertisement will result in not advertising an address at all.
|
|
166
|
-
So it is advised to specify an interface name instead of a specific address.
|
|
167
|
-
</li>
|
|
168
|
-
</ul>
|
|
169
|
-
<li><strong>Custom MDNS Configuration (DEPRECATED, use Bind)</strong>: Check if you would like to use custom mdns configuration.</li>
|
|
170
|
-
<ul>
|
|
171
|
-
<li><strong>Multicast</strong>: Use udp multicasting. Optional. Default true.</li>
|
|
172
|
-
<li><strong>Multicast Interface IP:</strong>: Explicitly specify a network interface. Optional. Defaults to all.</li>
|
|
173
|
-
<li><strong>Port</strong>: Set the udp port. Cannot be 1880 as it is reserved for node-red. Optional. Default 5353.</li>
|
|
174
|
-
<li><strong>Multicast Address IP</strong>: Set the udp ip. Optional. </li>
|
|
175
|
-
<li><strong>TTL</strong>: Set the multicast ttl. Optional. </li>
|
|
176
|
-
<li><strong>Loopback</strong>: Receive your own packets. Optional. Default true.</li>
|
|
177
|
-
<li><strong>Reuse Address</strong>: Set the reuseAddr option when creating the socket. Optional. Default true.</li>
|
|
178
|
-
</ul>
|
|
179
|
-
</ul>
|
|
177
|
+
> [!NOTE]
|
|
178
|
+
> If HomeKit discovery is unreliable, also check Docker networking, VLAN mDNS reflection, Wi-Fi isolation, VPN or container interfaces, duplicate bridge identifiers, and other mDNS responders using UDP 5353.
|
|
180
179
|
|
|
180
|
+
## Deprecated mDNS
|
|
181
|
+
|
|
182
|
+
> [!CAUTION]
|
|
183
|
+
> **Custom MDNS Configuration** is kept only so older flows can still open in the editor. It is ignored by the current runtime. Use **Bind** and **Advertiser** for active network configuration.
|
|
181
184
|
</script>
|
|
182
185
|
|
|
183
186
|
<script type="text/javascript">
|
|
@@ -291,6 +294,9 @@
|
|
|
291
294
|
labelStyle: function () {
|
|
292
295
|
return this.bridgeName ? 'node_label_italic' : ''
|
|
293
296
|
},
|
|
297
|
+
onadd: function () {
|
|
298
|
+
applyDefaultNodeDocumentation(this, 'homekit-bridge')
|
|
299
|
+
},
|
|
294
300
|
oneditprepare: function () {
|
|
295
301
|
if (!validatePinCode(this.pinCode)) {
|
|
296
302
|
this.pinCode = generatePinCode()
|
|
@@ -309,10 +315,12 @@
|
|
|
309
315
|
'#node-config-input-customMdnsConfig',
|
|
310
316
|
)
|
|
311
317
|
let mdnsConfiguration = $('#mdns-configuration')
|
|
318
|
+
let mdnsConfigurationSection = mdnsConfiguration.closest('details')
|
|
312
319
|
|
|
313
320
|
customMdnsConfigCheckbox
|
|
314
321
|
.change(function () {
|
|
315
322
|
if (this.checked) {
|
|
323
|
+
mdnsConfigurationSection.prop('open', true)
|
|
316
324
|
mdnsConfiguration.fadeIn('fast')
|
|
317
325
|
} else {
|
|
318
326
|
mdnsConfiguration.fadeOut('fast')
|
|
@@ -325,6 +333,16 @@
|
|
|
325
333
|
default: 'str',
|
|
326
334
|
types: ['json', 'str']
|
|
327
335
|
})
|
|
336
|
+
|
|
337
|
+
applyAdvertiserRecommendation('#node-config-input-advertiser')
|
|
338
|
+
|
|
339
|
+
const pairingQRCode = RED.NRCHKBPairingQR || window.NRCHKBPairingQR
|
|
340
|
+
if (pairingQRCode) {
|
|
341
|
+
pairingQRCode.renderBridgeEditor(
|
|
342
|
+
this.id,
|
|
343
|
+
'#nrchkb-bridge-pairing-qr',
|
|
344
|
+
)
|
|
345
|
+
}
|
|
328
346
|
},
|
|
329
347
|
})
|
|
330
348
|
</script>
|
package/build/nodes/bridge.js
CHANGED
|
@@ -1,13 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
4
15
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var import_logger = require("@nrchkb/logger");
|
|
25
|
+
var import_HostType = __toESM(require("../lib/types/HostType"));
|
|
26
|
+
const log = (0, import_logger.logger)("NRCHKB", "HAPHostNode");
|
|
9
27
|
module.exports = (RED) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
28
|
+
const HAPHostNode = require("../lib/HAPHostNode")(RED, import_HostType.default.BRIDGE);
|
|
29
|
+
log.debug("Registering homekit-bridge type");
|
|
30
|
+
RED.nodes.registerType("homekit-bridge", HAPHostNode.init);
|
|
13
31
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"qr": {
|
|
3
|
+
"accessories": "Accessories",
|
|
4
|
+
"alreadyPaired": "This bridge or accessory is already paired.",
|
|
5
|
+
"autoShowWhenPairingAvailable": "Auto show if something needs pairing",
|
|
6
|
+
"close": "Close",
|
|
7
|
+
"deployFirst": "Deploy this bridge or accessory to generate a pairing QR code.",
|
|
8
|
+
"flowTitle": "HomeKit Bridge",
|
|
9
|
+
"imageAlt": "HomeKit pairing QR code",
|
|
10
|
+
"loading": "Loading pairing state...",
|
|
11
|
+
"noAccessories": "No flow nodes reference this pairing host.",
|
|
12
|
+
"noBridges": "Nothing to be paired.",
|
|
13
|
+
"noUnpaired": "Nothing to be paired.",
|
|
14
|
+
"ready": "Ready to pair",
|
|
15
|
+
"refresh": "Refresh",
|
|
16
|
+
"sectionTitle": "Pairing QR Code",
|
|
17
|
+
"sidebarName": "HomeKit Pairing",
|
|
18
|
+
"sidebarTitle": "NRCHKB",
|
|
19
|
+
"unavailable": "Pairing QR code is not available.",
|
|
20
|
+
"unknownAccessory": "Accessory"
|
|
21
|
+
}
|
|
22
|
+
}
|