node-red-contrib-homekit-bridged 2.0.0-dev.4 → 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.
Files changed (125) hide show
  1. package/build/lib/HAPHostNode.js +183 -141
  2. package/build/lib/HAPServiceNode.js +199 -172
  3. package/build/lib/HAPServiceNode2.js +207 -172
  4. package/build/lib/NRCHKBError.js +23 -2
  5. package/build/lib/PairingQRCode.js +62 -0
  6. package/build/lib/Storage.js +157 -92
  7. package/build/lib/api.js +654 -288
  8. package/build/lib/camera/CameraControl.js +125 -0
  9. package/build/lib/camera/CameraDelegate.js +507 -0
  10. package/build/lib/camera/MP4StreamingServer.js +159 -0
  11. package/build/lib/hap/HAPCharacteristic.js +25 -4
  12. package/build/lib/hap/HAPService.js +25 -4
  13. package/build/lib/hap/eve-app/EveCharacteristics.js +124 -81
  14. package/build/lib/hap/eve-app/EveServices.js +50 -17
  15. package/build/lib/hap/hap-nodejs.js +32 -0
  16. package/build/lib/migration/HomeKitService2Migration.js +34 -0
  17. package/build/lib/migration/NodeMigration.js +75 -0
  18. package/build/lib/types/AccessoryInformationType.js +15 -1
  19. package/build/lib/types/CameraConfigType.js +15 -1
  20. package/build/lib/types/CustomCharacteristicType.js +15 -1
  21. package/build/lib/types/HAPHostConfigType.js +15 -1
  22. package/build/lib/types/HAPHostNodeType.js +15 -1
  23. package/build/lib/types/HAPService2ConfigType.js +15 -1
  24. package/build/lib/types/HAPService2NodeType.js +15 -1
  25. package/build/lib/types/HAPServiceConfigType.js +15 -1
  26. package/build/lib/types/HAPServiceNodeType.js +15 -1
  27. package/build/lib/types/HAPStatusConfigType.js +15 -1
  28. package/build/lib/types/HAPStatusNodeType.js +15 -1
  29. package/build/lib/types/HostType.js +28 -7
  30. package/build/lib/types/NodeType.js +15 -1
  31. package/build/lib/types/PublishTimersType.js +15 -1
  32. package/build/lib/types/UniFiControllerConfigType.js +16 -0
  33. package/build/lib/types/hap-nodejs/HapAdaptiveLightingControllerMode.js +28 -7
  34. package/build/lib/types/hap-nodejs/HapCategories.js +64 -43
  35. package/build/lib/types/storage/SerializedHostType.js +15 -1
  36. package/build/lib/types/storage/StorageType.js +34 -10
  37. package/build/lib/unifi/ProtectDiscovery.js +80 -0
  38. package/build/lib/utils/AccessoryUtils.js +152 -110
  39. package/build/lib/utils/BridgeUtils.js +82 -39
  40. package/build/lib/utils/CharacteristicUtils.js +5 -49
  41. package/build/lib/utils/CharacteristicUtils2.js +5 -49
  42. package/build/lib/utils/CharacteristicUtilsBase.js +81 -0
  43. package/build/lib/utils/NodeStatusUtils.js +89 -40
  44. package/build/lib/utils/ServiceUtils.js +434 -373
  45. package/build/lib/utils/ServiceUtils2.js +514 -307
  46. package/build/lib/utils/index.js +10 -11
  47. package/build/nodes/bridge.html +184 -166
  48. package/build/nodes/bridge.js +27 -9
  49. package/build/nodes/locales/en-US/node-red-contrib-homekit-bridged.json +22 -0
  50. package/build/nodes/nrchkb.html +1601 -88
  51. package/build/nodes/nrchkb.js +66 -88
  52. package/build/nodes/plugin-instance.html +499 -0
  53. package/build/nodes/plugin-instance.js +46 -0
  54. package/build/nodes/service.html +517 -299
  55. package/build/nodes/service.js +5 -6
  56. package/build/nodes/service2.html +1683 -460
  57. package/build/nodes/service2.js +5 -8
  58. package/build/nodes/standalone.html +187 -174
  59. package/build/nodes/standalone.js +27 -9
  60. package/build/nodes/status.html +51 -18
  61. package/build/nodes/status.js +47 -40
  62. package/build/nodes/unifi-controller.html +92 -0
  63. package/build/nodes/unifi-controller.js +20 -0
  64. package/build/plugins/embedded/homebridge-camera-ffmpeg/index.js +479 -0
  65. package/build/plugins/embedded/homebridge-unifi-protect/index.js +521 -0
  66. package/build/plugins/embedded/index.js +58 -0
  67. package/build/plugins/nrchkb-homekit-plugins.js +17 -0
  68. package/build/plugins/registry/index.js +203 -0
  69. package/build/plugins/registry/types.js +16 -0
  70. package/build/scripts/migrate-homekit-service-flows.js +47 -0
  71. package/examples/demo/01 - ALL Demos single import.json +1885 -1885
  72. package/examples/demo/02 - Air Purifier.json +279 -279
  73. package/examples/demo/03 - Air Quality sensor with Battery.json +254 -254
  74. package/examples/demo/04 - Dimmable Bulb.json +172 -172
  75. package/examples/demo/05 - Color Bulb (HSV).json +195 -195
  76. package/examples/demo/06 - Fan (simple, 3 speeds).json +240 -240
  77. package/examples/demo/07 - Fan (with speed, oscillate, rotation direction).json +175 -175
  78. package/examples/demo/08 - CO2 detector.json +224 -224
  79. package/examples/demo/09 - CO (carbon monoxide) example.json +255 -255
  80. package/examples/demo/10 - Door window contact sensor.json +234 -234
  81. package/examples/demos (advanced)/01 - Television with inputs and speaker.json +541 -541
  82. package/examples/switch/01 - Plain Switch.json +178 -178
  83. package/package.json +95 -84
  84. package/build/lib/HAPHostNode.d.ts +0 -1
  85. package/build/lib/HAPServiceNode.d.ts +0 -1
  86. package/build/lib/HAPServiceNode2.d.ts +0 -1
  87. package/build/lib/NRCHKBError.d.ts +0 -3
  88. package/build/lib/Storage.d.ts +0 -30
  89. package/build/lib/api.d.ts +0 -1
  90. package/build/lib/hap/HAPCharacteristic.d.ts +0 -9
  91. package/build/lib/hap/HAPService.d.ts +0 -6
  92. package/build/lib/hap/eve-app/EveCharacteristics.d.ts +0 -20
  93. package/build/lib/hap/eve-app/EveServices.d.ts +0 -5
  94. package/build/lib/types/AccessoryInformationType.d.ts +0 -11
  95. package/build/lib/types/CameraConfigType.d.ts +0 -24
  96. package/build/lib/types/CustomCharacteristicType.d.ts +0 -6
  97. package/build/lib/types/HAPHostConfigType.d.ts +0 -22
  98. package/build/lib/types/HAPHostNodeType.d.ts +0 -14
  99. package/build/lib/types/HAPService2ConfigType.d.ts +0 -6
  100. package/build/lib/types/HAPService2NodeType.d.ts +0 -7
  101. package/build/lib/types/HAPServiceConfigType.d.ts +0 -26
  102. package/build/lib/types/HAPServiceNodeType.d.ts +0 -38
  103. package/build/lib/types/HAPStatusConfigType.d.ts +0 -5
  104. package/build/lib/types/HAPStatusNodeType.d.ts +0 -12
  105. package/build/lib/types/HostType.d.ts +0 -5
  106. package/build/lib/types/NodeType.d.ts +0 -3
  107. package/build/lib/types/PublishTimersType.d.ts +0 -4
  108. package/build/lib/types/hap-nodejs/HapAdaptiveLightingControllerMode.d.ts +0 -5
  109. package/build/lib/types/hap-nodejs/HapCategories.d.ts +0 -41
  110. package/build/lib/types/storage/SerializedHostType.d.ts +0 -5
  111. package/build/lib/types/storage/StorageType.d.ts +0 -8
  112. package/build/lib/utils/AccessoryUtils.d.ts +0 -1
  113. package/build/lib/utils/BridgeUtils.d.ts +0 -1
  114. package/build/lib/utils/CharacteristicUtils.d.ts +0 -1
  115. package/build/lib/utils/CharacteristicUtils2.d.ts +0 -1
  116. package/build/lib/utils/NodeStatusUtils.d.ts +0 -17
  117. package/build/lib/utils/ServiceUtils.d.ts +0 -1
  118. package/build/lib/utils/ServiceUtils2.d.ts +0 -1
  119. package/build/lib/utils/index.d.ts +0 -1
  120. package/build/nodes/bridge.d.ts +0 -1
  121. package/build/nodes/nrchkb.d.ts +0 -1
  122. package/build/nodes/service.d.ts +0 -1
  123. package/build/nodes/service2.d.ts +0 -1
  124. package/build/nodes/standalone.d.ts +0 -1
  125. package/build/nodes/status.d.ts +0 -1
@@ -1,14 +1,13 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
2
  module.exports = (node) => {
4
- const ServiceUtils = require('./ServiceUtils')(node);
5
- const BridgeUtils = require('./BridgeUtils')();
6
- const AccessoryUtils = require('./AccessoryUtils')(node);
7
- const CharacteristicUtils = require('./CharacteristicUtils')(node);
8
- return {
9
- ServiceUtils,
10
- BridgeUtils,
11
- AccessoryUtils,
12
- CharacteristicUtils
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
  };
@@ -1,183 +1,186 @@
1
1
  <script data-template-name="homekit-bridge" type="text/x-red">
2
- <div class="form-row">
3
- <label for="node-config-input-pinCode"><i class="fa fa-lock"></i> Pin Code</label>
4
- <input type="text" id="node-config-input-pinCode" placeholder="xxxx-xxxx">
5
- </div>
6
- <div class="form-row">
7
- <label for="node-config-input-port"><i class="fa fa-plug"></i> Port</label>
8
- <input type="text" id="node-config-input-port" placeholder="Leave blank to auto assign">
9
- </div>
10
- <div class="form-row">
11
- <label for="node-config-input-advertiser"><i class="fa fa-globe"></i> Advertiser</label>
12
- <select id="node-config-input-advertiser">
13
- <option value="bonjour-hap" selected="selected">BONJOUR</option>
14
- <option value="ciao">CIAO</option>
15
- <option value="avahi">AVAHI</option>
16
- <option value="resolved">RESOLVED</option>
17
- </select>
18
- </div>
19
- <div class="form-row">
20
- <label>&nbsp;</label>
21
- <input type="checkbox" id="node-config-input-allowInsecureRequest" style="display: inline-block; width: auto; vertical-align: top;">
22
- <label for="node-config-input-allowInsecureRequest" style="width: 70%;">&nbsp;&nbsp;<i class="fa fa-shield"></i> Allow Insecure Request</label>
23
- </div>
24
- <div class="form-row">
25
- <label for="node-config-input-manufacturer"><i class="fa fa-wrench"></i> Manufacturer</label>
26
- <input type="text" id="node-config-input-manufacturer" placeholder="Manufacturer">
27
- </div>
28
- <div class="form-row">
29
- <label for="node-config-input-serialNo"><i class="fa fa-wrench"></i> Serial Number</label>
30
- <input type="text" id="node-config-input-serialNo" placeholder="Serial Number">
31
- </div>
32
- <div class="form-row">
33
- <label for="node-config-input-model"><i class="fa fa-wrench"></i> Model</label>
34
- <input type="text" id="node-config-input-model" placeholder="Model">
35
- </div>
36
- <div class="form-row">
37
- <label for="node-config-input-firmwareRev"><i class="fa fa-wrench"></i> Firmware Revision</label>
38
- <input type="text" id="node-config-input-firmwareRev" placeholder="Firmware Revision">
39
- </div>
40
- <div class="form-row">
41
- <label for="node-config-input-hardwareRev"><i class="fa fa-wrench"></i> Hardware Revision</label>
42
- <input type="text" id="node-config-input-hardwareRev" placeholder="Hardware Revision">
43
- </div>
44
- <div class="form-row">
45
- <label for="node-config-input-softwareRev"><i class="fa fa-wrench"></i> Software Revision</label>
46
- <input type="text" id="node-config-input-softwareRev" placeholder="Software Revision">
47
- </div>
48
- <div class="form-row">
49
- <label for="node-config-input-bridgeName"><i class="fa fa-tag"></i> Name</label>
50
- <input type="text" id="node-config-input-bridgeName" placeholder="Name">
51
- </div>
52
- <hr>
53
- <div class="form-row">
54
- <input type="checkbox" id="node-config-input-allowMessagePassthrough" style="display: inline-block; width: auto; vertical-align: top;">
55
- <label for="node-config-input-allowMessagePassthrough" style="width: 70%;">&nbsp;&nbsp;<i class="fa fa-step-forward"></i> Allow Message Passthrough</label>
56
- </div>
57
- <hr>
58
- <div class="form-row">
59
- <label for="node-config-input-bind"><i class="fa fa-filter"></i> Bind</label>
60
- <input type="text" id="node-config-input-bind" placeholder="::">
61
- <input type="hidden" id="node-config-input-bindType">
62
- </div>
63
- <div class="form-row">
64
- <input type="checkbox" id="node-config-input-customMdnsConfig" style="display: inline-block; width: auto; vertical-align: top;">
65
- <label for="node-config-input-customMdnsConfig" style="width: 70%;">&nbsp;&nbsp;<i class="fa fa-filter"></i> Custom MDNS Configuration (DEPRECATED, use Bind)</label>
66
- </div>
67
- <div id="mdns-configuration" style="display: none;">
68
- <div class="form-row">
69
- <label for="node-config-input-mdnsMulticast"><i class="fa fa-ellipsis-v"></i> Multicast</label>
70
- <input type="checkbox" id="node-config-input-mdnsMulticast" checked>
71
- </div>
72
- <div class="form-row">
73
- <label for="node-config-input-mdnsInterface"><i class="fa fa-location-arrow"></i> Multicast Interface IP</label>
74
- <input type="text" id="node-config-input-mdnsInterface" placeholder="">
75
- </div>
76
- <div class="form-row">
77
- <label for="node-config-input-mdnsPort"><i class="fa fa-location-arrow"></i> Port</label>
78
- <input type="text" id="node-config-input-mdnsPort" placeholder="">
79
- </div>
80
- <div class="form-row">
81
- <label for="node-config-input-mdnsIp"><i class="fa fa-location-arrow"></i> Multicast Address IP</label>
82
- <input type="text" id="node-config-input-mdnsIp" placeholder="">
83
- </div>
84
- <div class="form-row">
85
- <label for="node-config-input-mdnsTtl"><i class="fa fa-repeat"></i> TTL</label>
86
- <input type="text" id="node-config-input-mdnsTtl" placeholder="255">
87
- </div>
88
- <div class="form-row">
89
- <label for="node-config-input-mdnsLoopback"><i class="fa fa-undo"></i> Loopback</label>
90
- <input type="checkbox" id="node-config-input-mdnsLoopback" checked>
91
- </div>
92
- <div class="form-row">
93
- <label for="node-config-input-mdnsReuseAddr"><i class="fa fa-location-arrow"></i> Reuse Address</label>
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 &amp; 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/x-red">
102
- <h3 id="toc_4">Bridge</h3>
103
- <p>The Bridge node is a configuration node, specifying the <em>bridge</em> that iOS sees, i.e. the device that is manually being added by the user. All accessories behind a bridge node are then automatically added by iOS.
104
- </p>
105
- <ul>
106
- <li><strong>Pin Code</strong>: Specify the Pin for the pairing process.</li>
107
- <li><strong>Port</strong>: If you are behind a Firewall, you may want to specify a port. Cannot be 1880 as it is reserved for node-red. Otherwise, leave empty.</li>
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&#39;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
- This property accepts a mixture of IPAddresses and network interface names.
124
- Depending on the mixture of supplied addresses/names hap-nodejs will bind differently.
153
+ > [!WARNING]
154
+ > **Allow Insecure Request** permits unencrypted HomeKit requests. Leave it disabled unless a deliberate test client requires it.
125
155
 
126
- It is advised to not just bind to a specific address, but specifying the interface name
127
- in oder to bind on all address records (and ip version) available.
156
+ ## Pairing
128
157
 
129
- HAP-NodeJS (or the underlying ciao library) will not report about misspelled interface names,
130
- as it could be that the interface is currently just down and will come up later.
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
- Here are a few examples:
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
- - bind: "0.0.0.0"
138
- Binding TCP socket to the unspecified ipv4 address.
139
- The mdns advertisement will exclude any ipv6 address records.
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
- - bind: ["en0", "lo0"]
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
- - bind: ["en0", "lo0", "0.0.0.0"]
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
- - bind: "169.254.104.90"
152
- This will bind the HAP server to the address 0.0.0.0.
153
- The mdns advertisement will only advertise the A record 169.254.104.90.
154
- If the given network interface of that address encounters an ip address change (to a different address),
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
- - bind: ["169.254.104.90", "192.168.1.4"]
160
- As the HAP TCP socket can only bind to a single address, when specifying multiple ip addresses
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>
@@ -1,13 +1,31 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
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
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const logger_1 = require("@nrchkb/logger");
7
- const HostType_1 = __importDefault(require("../lib/types/HostType"));
8
- const log = (0, logger_1.logger)('NRCHKB', 'HAPHostNode');
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
- const HAPHostNode = require('../lib/HAPHostNode')(RED, HostType_1.default.BRIDGE);
11
- log.debug('Registering homekit-bridge type');
12
- RED.nodes.registerType('homekit-bridge', HAPHostNode.init);
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
+ }