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.
Files changed (128) 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 +119 -84
  9. package/build/lib/camera/CameraDelegate.js +481 -404
  10. package/build/lib/camera/MP4StreamingServer.js +148 -139
  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 -375
  45. package/build/lib/utils/ServiceUtils2.js +514 -309
  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/camera/CameraControl.d.ts +0 -3
  91. package/build/lib/camera/CameraDelegate.d.ts +0 -38
  92. package/build/lib/camera/MP4StreamingServer.d.ts +0 -26
  93. package/build/lib/hap/HAPCharacteristic.d.ts +0 -9
  94. package/build/lib/hap/HAPService.d.ts +0 -6
  95. package/build/lib/hap/eve-app/EveCharacteristics.d.ts +0 -20
  96. package/build/lib/hap/eve-app/EveServices.d.ts +0 -5
  97. package/build/lib/types/AccessoryInformationType.d.ts +0 -11
  98. package/build/lib/types/CameraConfigType.d.ts +0 -24
  99. package/build/lib/types/CustomCharacteristicType.d.ts +0 -6
  100. package/build/lib/types/HAPHostConfigType.d.ts +0 -22
  101. package/build/lib/types/HAPHostNodeType.d.ts +0 -14
  102. package/build/lib/types/HAPService2ConfigType.d.ts +0 -6
  103. package/build/lib/types/HAPService2NodeType.d.ts +0 -7
  104. package/build/lib/types/HAPServiceConfigType.d.ts +0 -26
  105. package/build/lib/types/HAPServiceNodeType.d.ts +0 -38
  106. package/build/lib/types/HAPStatusConfigType.d.ts +0 -5
  107. package/build/lib/types/HAPStatusNodeType.d.ts +0 -12
  108. package/build/lib/types/HostType.d.ts +0 -5
  109. package/build/lib/types/NodeType.d.ts +0 -3
  110. package/build/lib/types/PublishTimersType.d.ts +0 -4
  111. package/build/lib/types/hap-nodejs/HapAdaptiveLightingControllerMode.d.ts +0 -5
  112. package/build/lib/types/hap-nodejs/HapCategories.d.ts +0 -41
  113. package/build/lib/types/storage/SerializedHostType.d.ts +0 -5
  114. package/build/lib/types/storage/StorageType.d.ts +0 -8
  115. package/build/lib/utils/AccessoryUtils.d.ts +0 -1
  116. package/build/lib/utils/BridgeUtils.d.ts +0 -1
  117. package/build/lib/utils/CharacteristicUtils.d.ts +0 -1
  118. package/build/lib/utils/CharacteristicUtils2.d.ts +0 -1
  119. package/build/lib/utils/NodeStatusUtils.d.ts +0 -17
  120. package/build/lib/utils/ServiceUtils.d.ts +0 -1
  121. package/build/lib/utils/ServiceUtils2.d.ts +0 -1
  122. package/build/lib/utils/index.d.ts +0 -1
  123. package/build/nodes/bridge.d.ts +0 -1
  124. package/build/nodes/nrchkb.d.ts +0 -1
  125. package/build/nodes/service.d.ts +0 -1
  126. package/build/nodes/service2.d.ts +0 -1
  127. package/build/nodes/standalone.d.ts +0 -1
  128. package/build/nodes/status.d.ts +0 -1
@@ -1,11 +1,8 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const logger_1 = require("@nrchkb/logger");
4
- const log = (0, logger_1.logger)('NRCHKB', 'HAPServiceNode2');
2
+ var import_logger = require("@nrchkb/logger");
3
+ const log = (0, import_logger.logger)("NRCHKB", "HAPServiceNode2");
5
4
  module.exports = (RED) => {
6
- const HAPServiceNode2 = require('../lib/HAPServiceNode2')(RED);
7
- if (process.env.NRCHKB_EXPERIMENTAL === 'true') {
8
- log.debug('Registering homekit-service2 type');
9
- RED.nodes.registerType('homekit-service2', HAPServiceNode2.preInit);
10
- }
5
+ const HAPServiceNode2 = require("../lib/HAPServiceNode2")(RED);
6
+ log.debug("Registering homekit-service2 type");
7
+ RED.nodes.registerType("homekit-service2", HAPServiceNode2.preInit);
11
8
  };
@@ -1,189 +1,188 @@
1
1
  <script data-template-name="homekit-standalone" type="text/x-red">
2
- <div class="form-row">
3
- <label for="node-config-input-accessoryCategory">
4
- <i class="fa fa-cog"></i>
5
- Accessory Category</label>
6
- <select id="node-config-input-accessoryCategory">
7
- <option value="">Choose...</option>
8
- </select>
9
- </div>
10
- <div class="form-row">
11
- <label for="node-config-input-pinCode"><i class="fa fa-lock"></i> Pin Code</label>
12
- <input type="text" id="node-config-input-pinCode" placeholder="xxxx-xxxx">
13
- </div>
14
- <div class="form-row">
15
- <label for="node-config-input-port"><i class="fa fa-plug"></i> Port</label>
16
- <input type="text" id="node-config-input-port" placeholder="Leave blank to auto assign">
17
- </div>
18
- <div class="form-row">
19
- <label for="node-config-input-advertiser"><i class="fa fa-globe"></i> Advertiser</label>
20
- <select id="node-config-input-advertiser">
21
- <option value="bonjour-hap" selected="selected">BONJOUR</option>
22
- <option value="ciao">CIAO</option>
23
- <option value="avahi">AVAHI</option>
24
- <option value="resolved">RESOLVED</option>
25
- </select>
26
- </div>
27
- <div class="form-row">
28
- <label>&nbsp;</label>
29
- <input type="checkbox" id="node-config-input-allowInsecureRequest" style="display: inline-block; width: auto; vertical-align: top;">
30
- <label for="node-config-input-allowInsecureRequest" style="width: 70%;">&nbsp;&nbsp;<i class="fa fa-shield"></i> Allow Insecure Request</label>
31
- </div>
32
- <div class="form-row">
33
- <label for="node-config-input-manufacturer"><i class="fa fa-wrench"></i> Manufacturer</label>
34
- <input type="text" id="node-config-input-manufacturer" placeholder="Manufacturer">
35
- </div>
36
- <div class="form-row">
37
- <label for="node-config-input-serialNo"><i class="fa fa-wrench"></i> Serial Number</label>
38
- <input type="text" id="node-config-input-serialNo" placeholder="Serial Number">
39
- </div>
40
- <div class="form-row">
41
- <label for="node-config-input-model"><i class="fa fa-wrench"></i> Model</label>
42
- <input type="text" id="node-config-input-model" placeholder="Model">
43
- </div>
44
- <div class="form-row">
45
- <label for="node-config-input-firmwareRev"><i class="fa fa-wrench"></i> Firmware Revision</label>
46
- <input type="text" id="node-config-input-firmwareRev" placeholder="Firmware Revision">
47
- </div>
48
- <div class="form-row">
49
- <label for="node-config-input-hardwareRev"><i class="fa fa-wrench"></i> Hardware Revision</label>
50
- <input type="text" id="node-config-input-hardwareRev" placeholder="Hardware Revision">
51
- </div>
52
- <div class="form-row">
53
- <label for="node-config-input-softwareRev"><i class="fa fa-wrench"></i> Software Revision</label>
54
- <input type="text" id="node-config-input-softwareRev" placeholder="Software Revision">
55
- </div>
56
- <div class="form-row">
57
- <label for="node-config-input-bridgeName"><i class="fa fa-tag"></i> Name</label>
58
- <input type="text" id="node-config-input-bridgeName" placeholder="Name">
59
- </div>
60
- <hr>
61
- <div class="form-row">
62
- <input type="checkbox" id="node-config-input-allowMessagePassthrough" style="display: inline-block; width: auto; vertical-align: top;">
63
- <label for="node-config-input-allowMessagePassthrough" style="width: 70%;">&nbsp;&nbsp;<i class="fa fa-step-forward"></i> Allow Message Passthrough</label>
64
- </div>
65
- <hr>
66
- <div class="form-row">
67
- <label for="node-config-input-bind"><i class="fa fa-filter"></i> Bind</label>
68
- <input type="text" id="node-config-input-bind" placeholder="::">
69
- <input type="hidden" id="node-config-input-bindType">
70
- </div>
71
- <div class="form-row">
72
- <input type="checkbox" id="node-config-input-customMdnsConfig" style="display: inline-block; width: auto; vertical-align: top;">
73
- <label for="node-config-input-customMdnsConfig" style="width: 70%;">&nbsp;&nbsp;<i class="fa fa-filter"></i> Custom MDNS Configuration (DEPRECATED, use Bind)</label>
74
- </div>
75
- <div id="mdns-configuration" style="display: none;">
76
- <div class="form-row">
77
- <label for="node-config-input-mdnsMulticast"><i class="fa fa-ellipsis-v"></i> Multicast</label>
78
- <input type="checkbox" id="node-config-input-mdnsMulticast" checked>
79
- </div>
80
- <div class="form-row">
81
- <label for="node-config-input-mdnsInterface"><i class="fa fa-location-arrow"></i> Multicast Interface IP</label>
82
- <input type="text" id="node-config-input-mdnsInterface" placeholder="">
83
- </div>
84
- <div class="form-row">
85
- <label for="node-config-input-mdnsPort"><i class="fa fa-location-arrow"></i> Port</label>
86
- <input type="text" id="node-config-input-mdnsPort" placeholder="">
87
- </div>
88
- <div class="form-row">
89
- <label for="node-config-input-mdnsIp"><i class="fa fa-location-arrow"></i> Multicast Address IP</label>
90
- <input type="text" id="node-config-input-mdnsIp" placeholder="">
91
- </div>
92
- <div class="form-row">
93
- <label for="node-config-input-mdnsTtl"><i class="fa fa-repeat"></i> TTL</label>
94
- <input type="text" id="node-config-input-mdnsTtl" placeholder="255">
95
- </div>
96
- <div class="form-row">
97
- <label for="node-config-input-mdnsLoopback"><i class="fa fa-undo"></i> Loopback</label>
98
- <input type="checkbox" id="node-config-input-mdnsLoopback" checked>
99
- </div>
100
- <div class="form-row">
101
- <label for="node-config-input-mdnsReuseAddr"><i class="fa fa-location-arrow"></i> Reuse Address</label>
102
- <input type="checkbox" id="node-config-input-mdnsReuseAddr" checked>
103
- </div>
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-accessoryCategory">
12
+ <i class="fa fa-cubes"></i>
13
+ Accessory Category
14
+ </label>
15
+ <select id="node-config-input-accessoryCategory">
16
+ <option value="">Choose...</option>
17
+ </select>
18
+ </div>
19
+ <div class="form-row">
20
+ <label for="node-config-input-pinCode"><i class="fa fa-key"></i> Pin Code</label>
21
+ <input type="text" id="node-config-input-pinCode" placeholder="xxxx-xxxx">
22
+ </div>
23
+ <div class="form-row nrchkb-checkbox-row">
24
+ <label class="nrchkb-checkbox-label" for="node-config-input-allowInsecureRequest">
25
+ <input type="checkbox" id="node-config-input-allowInsecureRequest">
26
+ <span><i class="fa fa-unlock-alt"></i> Allow Insecure Request</span>
27
+ </label>
28
+ </div>
29
+ <details class="nrchkb-section" open>
30
+ <summary><i class="fa fa-qrcode"></i> <span data-i18n="node-red-contrib-homekit-bridged/qr.sectionTitle">Pairing QR Code</span></summary>
31
+ <div class="nrchkb-section-body" id="nrchkb-standalone-pairing-qr">
32
+ <p class="nrchkb-pairing-message" data-i18n="node-red-contrib-homekit-bridged/qr.loading">Loading pairing state...</p>
33
+ </div>
34
+ </details>
35
+ </div>
36
+ </details>
37
+
38
+ <details class="nrchkb-section" open>
39
+ <summary><i class="fa fa-wifi"></i> Network &amp; Advertising</summary>
40
+ <div class="nrchkb-section-body">
41
+ <div class="form-row">
42
+ <label for="node-config-input-port"><i class="fa fa-plug"></i> Port</label>
43
+ <input type="text" id="node-config-input-port" placeholder="Leave blank to auto assign">
44
+ </div>
45
+ <div class="form-row">
46
+ <label for="node-config-input-advertiser"><i class="fa fa-bullhorn"></i> Advertiser</label>
47
+ <select id="node-config-input-advertiser">
48
+ <option value="bonjour-hap" selected="selected">BONJOUR</option>
49
+ <option value="ciao">CIAO</option>
50
+ <option value="avahi">AVAHI</option>
51
+ <option value="resolved">RESOLVED</option>
52
+ </select>
53
+ </div>
54
+ <div class="form-row">
55
+ <label for="node-config-input-bind"><i class="fa fa-sitemap"></i> Bind</label>
56
+ <input type="text" id="node-config-input-bind" placeholder="::">
57
+ <input type="hidden" id="node-config-input-bindType">
58
+ </div>
59
+ </div>
60
+ </details>
61
+
62
+ <details class="nrchkb-section">
63
+ <summary><i class="fa fa-id-card-o"></i> Accessory Metadata</summary>
64
+ <div class="nrchkb-section-body">
65
+ <div class="form-row">
66
+ <label for="node-config-input-manufacturer"><i class="fa fa-industry"></i> Manufacturer</label>
67
+ <input type="text" id="node-config-input-manufacturer" placeholder="Manufacturer">
68
+ </div>
69
+ <div class="form-row">
70
+ <label for="node-config-input-serialNo"><i class="fa fa-barcode"></i> Serial Number</label>
71
+ <input type="text" id="node-config-input-serialNo" placeholder="Serial Number">
72
+ </div>
73
+ <div class="form-row">
74
+ <label for="node-config-input-model"><i class="fa fa-cube"></i> Model</label>
75
+ <input type="text" id="node-config-input-model" placeholder="Model">
76
+ </div>
77
+ <div class="form-row">
78
+ <label for="node-config-input-firmwareRev"><i class="fa fa-microchip"></i> Firmware Revision</label>
79
+ <input type="text" id="node-config-input-firmwareRev" placeholder="Firmware Revision">
80
+ </div>
81
+ <div class="form-row">
82
+ <label for="node-config-input-hardwareRev"><i class="fa fa-hdd-o"></i> Hardware Revision</label>
83
+ <input type="text" id="node-config-input-hardwareRev" placeholder="Hardware Revision">
84
+ </div>
85
+ <div class="form-row">
86
+ <label for="node-config-input-softwareRev"><i class="fa fa-code"></i> Software Revision</label>
87
+ <input type="text" id="node-config-input-softwareRev" placeholder="Software Revision">
88
+ </div>
89
+ </div>
90
+ </details>
91
+
92
+ <details class="nrchkb-section">
93
+ <summary><i class="fa fa-exchange"></i> Message Handling</summary>
94
+ <div class="nrchkb-section-body">
95
+ <div class="form-row nrchkb-checkbox-row">
96
+ <label class="nrchkb-checkbox-label" for="node-config-input-allowMessagePassthrough">
97
+ <input type="checkbox" id="node-config-input-allowMessagePassthrough">
98
+ <span><i class="fa fa-share"></i> Allow Message Passthrough</span>
99
+ </label>
100
+ </div>
101
+ </div>
102
+ </details>
103
+
104
+ <details class="nrchkb-section">
105
+ <summary><i class="fa fa-exclamation-triangle"></i> Deprecated mDNS</summary>
106
+ <div class="nrchkb-section-body">
107
+ <div class="form-row nrchkb-checkbox-row">
108
+ <label class="nrchkb-checkbox-label" for="node-config-input-customMdnsConfig">
109
+ <input type="checkbox" id="node-config-input-customMdnsConfig">
110
+ <span><i class="fa fa-exclamation-triangle"></i> Custom MDNS Configuration (DEPRECATED, use Bind)</span>
111
+ </label>
112
+ </div>
113
+ <div id="mdns-configuration" class="nrchkb-nested-panel" style="display: none;">
114
+ <div class="form-row nrchkb-checkbox-row">
115
+ <label class="nrchkb-checkbox-label" for="node-config-input-mdnsMulticast">
116
+ <input type="checkbox" id="node-config-input-mdnsMulticast" checked>
117
+ <span><i class="fa fa-share-alt"></i> Multicast</span>
118
+ </label>
119
+ </div>
120
+ <div class="form-row">
121
+ <label for="node-config-input-mdnsInterface"><i class="fa fa-sitemap"></i> Multicast Interface IP</label>
122
+ <input type="text" id="node-config-input-mdnsInterface" placeholder="">
123
+ </div>
124
+ <div class="form-row">
125
+ <label for="node-config-input-mdnsPort"><i class="fa fa-plug"></i> Port</label>
126
+ <input type="text" id="node-config-input-mdnsPort" placeholder="">
127
+ </div>
128
+ <div class="form-row">
129
+ <label for="node-config-input-mdnsIp"><i class="fa fa-map-marker"></i> Multicast Address IP</label>
130
+ <input type="text" id="node-config-input-mdnsIp" placeholder="">
131
+ </div>
132
+ <div class="form-row">
133
+ <label for="node-config-input-mdnsTtl"><i class="fa fa-clock-o"></i> TTL</label>
134
+ <input type="text" id="node-config-input-mdnsTtl" placeholder="255">
135
+ </div>
136
+ <div class="form-row nrchkb-checkbox-row">
137
+ <label class="nrchkb-checkbox-label" for="node-config-input-mdnsLoopback">
138
+ <input type="checkbox" id="node-config-input-mdnsLoopback" checked>
139
+ <span><i class="fa fa-refresh"></i> Loopback</span>
140
+ </label>
141
+ </div>
142
+ <div class="form-row nrchkb-checkbox-row">
143
+ <label class="nrchkb-checkbox-label" for="node-config-input-mdnsReuseAddr">
144
+ <input type="checkbox" id="node-config-input-mdnsReuseAddr" checked>
145
+ <span><i class="fa fa-recycle"></i> Reuse Address</span>
146
+ </label>
147
+ </div>
148
+ </div>
149
+ </div>
150
+ </details>
104
151
  </div>
105
- <hr>
106
152
  </script>
107
- <script data-help-name="homekit-standalone" type="text/x-red">
108
- <h3 id="toc_4">Bridge</h3>
109
- <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.
110
- </p>
111
- <ul>
112
- <li><strong>Accessory Category</strong>: What kind of category is this Accessory, default <em>OTHER</em></li>
113
- <li><strong>Pin Code</strong>: Specify the Pin for the pairing process.</li>
114
- <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>
115
- <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>
116
- <li><strong>Allow Insecure Request</strong>: Should we allow insecure request? Default false.</li>
117
- <li><strong>Manufacturer, Model, Serial Number</strong>: Can be anything you want.</li>
118
- <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>
119
- <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>
120
- <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>
121
- <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>
122
- <li><strong>Allow Message Passthrough</strong>: If you allow then message from node input will be sent to node output.</li>
123
- <li><strong>Bind</strong>: Defines the host where the HAP server will be bound to. </li>
124
- <ul>
125
- <li>
126
- Defines the host where the HAP server will be bound to.
127
- When undefined the HAP server will bind to all available interfaces
128
- (see https://nodejs.org/api/net.html#net_server_listen_port_host_backlog_callback).
153
+ <script data-help-name="homekit-standalone" type="text/markdown">
154
+ # Standalone HomeKit Accessory
155
+
156
+ Defines a HomeKit accessory that is paired directly in the Apple Home app. Use it when a service must be published as its own accessory instead of behind a shared bridge.
129
157
 
130
- This property accepts a mixture of IPAddresses and network interface names.
131
- Depending on the mixture of supplied addresses/names hap-nodejs will bind differently.
158
+ > [!IMPORTANT]
159
+ > Use a stable accessory name, category, PIN, serial number, and model. Changing identity fields can make HomeKit treat the accessory as a different device.
132
160
 
133
- It is advised to not just bind to a specific address, but specifying the interface name
134
- in oder to bind on all address records (and ip version) available.
161
+ > [!WARNING]
162
+ > **Allow Insecure Request** permits unencrypted HomeKit requests. Leave it disabled unless a deliberate test client requires it.
135
163
 
136
- HAP-NodeJS (or the underlying ciao library) will not report about misspelled interface names,
137
- as it could be that the interface is currently just down and will come up later.
164
+ ## Pairing
138
165
 
139
- Here are a few examples:
140
- - bind: "::"
141
- Pretty much identical to not specifying anything, as most systems (with ipv6 support)
142
- will default to the unspecified ipv6 address (with dual stack support).
166
+ - **Name**: Accessory name shown during pairing. HomeKit names can be up to 64 characters and must not contain a period.
167
+ - **Accessory Category**: Category HomeKit uses for the accessory icon and grouping. Defaults to `OTHER`.
168
+ - **Pin Code**: HomeKit setup code used when pairing this accessory.
169
+ - **Pairing QR Code**: Shows after the accessory is deployed and only while it is not paired.
143
170
 
144
- - bind: "0.0.0.0"
145
- Binding TCP socket to the unspecified ipv4 address.
146
- The mdns advertisement will exclude any ipv6 address records.
171
+ ## Network & Advertising
147
172
 
148
- - bind: ["en0", "lo0"]
149
- The mdns advertising will advertise all records of the en0 and loopback interface (if available) and
150
- will also react to address changes on those interfaces.
151
- In order for the HAP server to accept all those address records (which may contain ipv6 records)
152
- it will bind on the unspecified ipv6 address "::" (assuming dual stack is supported).
173
+ - **Port**: Optional HAP server port. Leave blank to auto-assign. Do not use `1880`, which is reserved for Node-RED.
174
+ - **Advertiser**: Selects the mDNS/DNS-SD backend used to announce this accessory to HomeKit.
175
+ - **Bind**: Restricts the network interfaces or IP addresses used by the HAP server and mDNS advertisement.
153
176
 
154
- - bind: ["en0", "lo0", "0.0.0.0"]
155
- Same as above, only that the HAP server will bind on the unspecified ipv4 address "0.0.0.0".
156
- The mdns advertisement will not advertise any ipv6 records.
177
+ <p class="nrchkb-advertiser-dynamic">Recommendation unavailable.</p>
157
178
 
158
- - bind: "169.254.104.90"
159
- This will bind the HAP server to the address 0.0.0.0.
160
- The mdns advertisement will only advertise the A record 169.254.104.90.
161
- If the given network interface of that address encounters an ip address change (to a different address),
162
- the mdns advertisement will result in not advertising an address at all.
163
- So it is advised to specify an interface name instead of a specific address.
164
- This is identical with ipv6 addresses.
179
+ > [!NOTE]
180
+ > If HomeKit discovery is unreliable, also check Docker networking, VLAN mDNS reflection, Wi-Fi isolation, VPN or container interfaces, duplicate accessory identifiers, and other mDNS responders using UDP 5353.
165
181
 
166
- - bind: ["169.254.104.90", "192.168.1.4"]
167
- As the HAP TCP socket can only bind to a single address, when specifying multiple ip addresses
168
- the HAP server will bind to the unspecified ip address (0.0.0.0 if only ipv4 addresses are supplied,
169
- :: if a mixture or only ipv6 addresses are supplied).
170
- The mdns advertisement will only advertise the specified ip addresses.
171
- If the given network interface of that address encounters an ip address change (to different addresses),
172
- the mdns advertisement will result in not advertising an address at all.
173
- So it is advised to specify an interface name instead of a specific address.
174
- </li>
175
- </ul>
176
- <li><strong>Custom MDNS Configuration (DEPRECATED, use Bind)</strong>: Check if you would like to use custom mdns configuration.</li>
177
- <ul>
178
- <li><strong>Multicast</strong>: Use udp multicasting. Optional. Default true.</li>
179
- <li><strong>Multicast Interface IP:</strong>: Explicitly specify a network interface. Optional. Defaults to all.</li>
180
- <li><strong>Port</strong>: Set the udp port. Cannot be 1880 as it is reserved for node-red. Optional. Default 5353.</li>
181
- <li><strong>Multicast Address IP</strong>: Set the udp ip. Optional. </li>
182
- <li><strong>TTL</strong>: Set the multicast ttl. Optional. </li>
183
- <li><strong>Loopback</strong>: Receive your own packets. Optional. Default true.</li>
184
- <li><strong>Reuse Address</strong>: Set the reuseAddr option when creating the socket. Optional. Default true.</li>
185
- </ul>
186
- </ul>
182
+ ## Deprecated mDNS
183
+
184
+ > [!CAUTION]
185
+ > **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.
187
186
  </script>
188
187
  <script type="text/javascript">
189
188
  RED.nodes.registerType('homekit-standalone', {
@@ -300,6 +299,9 @@
300
299
  labelStyle: function () {
301
300
  return this.bridgeName ? 'node_label_italic' : ''
302
301
  },
302
+ onadd: function () {
303
+ applyDefaultNodeDocumentation(this, 'homekit-standalone')
304
+ },
303
305
  oneditprepare: function () {
304
306
  const node = this
305
307
 
@@ -317,10 +319,12 @@
317
319
  '#node-config-input-customMdnsConfig',
318
320
  )
319
321
  let mdnsConfiguration = $('#mdns-configuration')
322
+ let mdnsConfigurationSection = mdnsConfiguration.closest('details')
320
323
 
321
324
  customMdnsConfigCheckbox
322
325
  .change(function () {
323
326
  if (this.checked) {
327
+ mdnsConfigurationSection.prop('open', true)
324
328
  mdnsConfiguration.fadeIn('fast')
325
329
  } else {
326
330
  mdnsConfiguration.fadeOut('fast')
@@ -350,6 +354,15 @@
350
354
  default: 'str',
351
355
  types: ['json', 'str']
352
356
  })
357
+
358
+ applyAdvertiserRecommendation('#node-config-input-advertiser')
359
+
360
+ if (RED.NRCHKBPairingQR) {
361
+ RED.NRCHKBPairingQR.renderHostEditor(
362
+ node.id,
363
+ '#nrchkb-standalone-pairing-qr',
364
+ )
365
+ }
353
366
  },
354
367
  })
355
368
  </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.STANDALONE);
11
- log.debug('Registering homekit-standalone type');
12
- RED.nodes.registerType('homekit-standalone', HAPHostNode.init);
28
+ const HAPHostNode = require("../lib/HAPHostNode")(RED, import_HostType.default.STANDALONE);
29
+ log.debug("Registering homekit-standalone type");
30
+ RED.nodes.registerType("homekit-standalone", HAPHostNode.init);
13
31
  };
@@ -1,22 +1,48 @@
1
1
  <!--suppress EqualityComparisonWithCoercionJS -->
2
2
  <script data-template-name="homekit-status" type="text/x-red">
3
- <div class="form-row">
4
- <label for="node-input-name">
5
- <i class="fa fa-tag"></i>
6
- Name</label>
7
- <input type="text" id="node-input-name" placeholder="Name">
3
+ <div class="nrchkb-editor">
4
+ <details class="nrchkb-section" open>
5
+ <summary><i class="fa fa-crosshairs"></i> Target Service</summary>
6
+ <div class="nrchkb-section-body">
7
+ <div class="form-row">
8
+ <label for="node-input-name">
9
+ <i class="fa fa-tag"></i>
10
+ Name
11
+ </label>
12
+ <input type="text" id="node-input-name" placeholder="Name">
13
+ </div>
14
+ <div class="form-row">
15
+ <label for="node-input-serviceNode">
16
+ <i class="fa fa-puzzle-piece"></i>
17
+ Service Node
18
+ </label>
19
+ <select id="node-input-serviceNode">
20
+ <option value="">Choose...</option>
21
+ </select>
22
+ </div>
23
+ </div>
24
+ </details>
8
25
  </div>
9
- <div class="form-row">
10
- <label for="node-input-serviceNode">
11
- <i class="fa fa-cog"></i>
12
- Service Node</label>
13
- <select id="node-input-serviceNode">
14
- <option value="">Choose...</option>
15
- </select>
16
- </div>
17
26
  </script>
18
27
 
19
- <script data-help-name="homekit-status" type="text/x-red">
28
+ <script data-help-name="homekit-status" type="text/markdown">
29
+ # HomeKit Status
30
+
31
+ Reads the selected `homekit-service` or `homekit-service2` node and outputs a serialized description of its current HomeKit service shape.
32
+
33
+ > [!NOTE]
34
+ > Any input message triggers a fresh read. The incoming payload is not used as a command.
35
+
36
+ ## Target Service
37
+
38
+ - **Name**: Optional label for this status node in the flow.
39
+ - **Service Node**: The `homekit-service` or `homekit-service2` node to inspect. In a subflow, only service nodes from the same subflow are listed.
40
+
41
+ ## Output Messages
42
+
43
+ Use the output for debugging, diagnostics, dashboards, migration checks, or flows that need to inspect which characteristics and values a service currently exposes.
44
+
45
+ The output includes the selected service metadata, characteristics, properties, and current values where the runtime can read them.
20
46
  </script>
21
47
 
22
48
  <script type="text/javascript">
@@ -52,6 +78,9 @@
52
78
  labelStyle: function () {
53
79
  return this.name ? 'node_label_italic' : ''
54
80
  },
81
+ onadd: function () {
82
+ applyDefaultNodeDocumentation(this, 'homekit-status')
83
+ },
55
84
  oneditprepare: function () {
56
85
  const node = this
57
86
  const selectServiceNode = $('#node-input-serviceNode')
@@ -67,6 +96,8 @@
67
96
 
68
97
  const inSubflow = !!RED.nodes.subflow(node.z)
69
98
 
99
+ const serviceOptions = []
100
+
70
101
  candidateNodes.forEach(function (n) {
71
102
  if (!n.name || (n.name.length && n.name.length < 1)) {
72
103
  return
@@ -98,13 +129,16 @@
98
129
  const value = n.id
99
130
  const text = n.name + ' (' + sublabel + ')'
100
131
 
101
- selectServiceNode.append(
102
- $('<option></option>')
132
+ serviceOptions.push({
133
+ text,
134
+ element: $('<option></option>')
103
135
  .val(value)
104
136
  .text(text)
105
- )
137
+ })
106
138
  })
107
139
 
140
+ sortSelectOptionsByLabel(selectServiceNode, serviceOptions)
141
+
108
142
  selectServiceNode
109
143
  .find('option')
110
144
  .filter(function () {
@@ -121,4 +155,3 @@
121
155
  },
122
156
  })
123
157
  </script>
124
-