node-red-contrib-homekit-bridged 2.0.0-dev.0 → 2.0.0-dev.10
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 +185 -148
- package/build/lib/HAPServiceNode.js +200 -177
- package/build/lib/HAPServiceNode2.js +208 -177
- package/build/lib/NRCHKBError.js +23 -2
- package/build/lib/PairingQRCode.js +62 -0
- package/build/lib/Storage.js +152 -90
- package/build/lib/api.js +654 -291
- package/build/lib/camera/CameraControl.js +125 -0
- package/build/lib/camera/CameraDelegate.js +507 -0
- package/build/lib/camera/MP4StreamingServer.js +159 -0
- 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 +95 -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 +433 -371
- package/build/lib/utils/ServiceUtils2.js +519 -305
- package/build/lib/utils/index.js +11 -12
- package/build/nodes/bridge.html +206 -168
- 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 +1753 -117
- package/build/nodes/nrchkb.js +66 -88
- package/build/nodes/plugin-instance.html +509 -0
- package/build/nodes/plugin-instance.js +46 -0
- package/build/nodes/service.html +557 -306
- package/build/nodes/service.js +5 -6
- package/build/nodes/service2.html +1735 -455
- package/build/nodes/service2.js +5 -8
- package/build/nodes/standalone.html +208 -176
- package/build/nodes/standalone.js +27 -9
- package/build/nodes/status.html +51 -18
- package/build/nodes/status.js +47 -41
- 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 -2139
- package/examples/demo/02 - Air Purifier.json +12 -61
- package/examples/demo/03 - Air Quality sensor with Battery.json +8 -36
- package/examples/demo/04 - Dimmable Bulb.json +4 -21
- package/examples/demo/05 - Color Bulb (HSV).json +5 -26
- package/examples/demo/06 - Fan (simple, 3 speeds).json +6 -31
- package/examples/demo/07 - Fan (with speed, oscillate, rotation direction).json +4 -21
- package/examples/demo/08 - CO2 detector.json +8 -39
- package/examples/demo/09 - CO (carbon monoxide) example.json +9 -44
- package/examples/demo/10 - Door window contact sensor.json +8 -39
- package/examples/demos (advanced)/01 - Television with inputs and speaker.json +19 -85
- package/examples/switch/01 - Plain Switch.json +179 -199
- package/package.json +48 -34
- 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/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/nodes/service2.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
const
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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="
|
|
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
|
-
<
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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" inputmode="numeric" autocomplete="off" spellcheck="false">
|
|
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 & 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" inputmode="numeric" autocomplete="off" spellcheck="false">
|
|
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="::" autocomplete="off" spellcheck="false">
|
|
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/
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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'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
|
-
|
|
131
|
-
|
|
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
|
-
|
|
134
|
-
|
|
161
|
+
> [!WARNING]
|
|
162
|
+
> **Allow Insecure Request** permits unencrypted HomeKit requests. Leave it disabled unless a deliberate test client requires it.
|
|
135
163
|
|
|
136
|
-
|
|
137
|
-
as it could be that the interface is currently just down and will come up later.
|
|
164
|
+
## Pairing
|
|
138
165
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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
|
-
|
|
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
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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
|
-
|
|
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
|
-
|
|
159
|
-
|
|
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
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
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,8 +299,30 @@
|
|
|
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
|
|
307
|
+
const prefersReducedMotion = function () {
|
|
308
|
+
return window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches
|
|
309
|
+
}
|
|
310
|
+
const showEditorSection = function (section) {
|
|
311
|
+
if (prefersReducedMotion()) {
|
|
312
|
+
section.stop(true, true).show()
|
|
313
|
+
return
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
section.stop(true, true).fadeIn('fast')
|
|
317
|
+
}
|
|
318
|
+
const hideEditorSection = function (section) {
|
|
319
|
+
if (prefersReducedMotion()) {
|
|
320
|
+
section.stop(true, true).hide()
|
|
321
|
+
return
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
section.stop(true, true).fadeOut('fast')
|
|
325
|
+
}
|
|
305
326
|
|
|
306
327
|
if (!validatePinCode(node.pinCode)) {
|
|
307
328
|
node.pinCode = generatePinCode()
|
|
@@ -317,13 +338,15 @@
|
|
|
317
338
|
'#node-config-input-customMdnsConfig',
|
|
318
339
|
)
|
|
319
340
|
let mdnsConfiguration = $('#mdns-configuration')
|
|
341
|
+
let mdnsConfigurationSection = mdnsConfiguration.closest('details')
|
|
320
342
|
|
|
321
343
|
customMdnsConfigCheckbox
|
|
322
344
|
.change(function () {
|
|
323
345
|
if (this.checked) {
|
|
324
|
-
|
|
346
|
+
mdnsConfigurationSection.prop('open', true)
|
|
347
|
+
showEditorSection(mdnsConfiguration)
|
|
325
348
|
} else {
|
|
326
|
-
mdnsConfiguration
|
|
349
|
+
hideEditorSection(mdnsConfiguration)
|
|
327
350
|
}
|
|
328
351
|
})
|
|
329
352
|
.change()
|
|
@@ -350,6 +373,15 @@
|
|
|
350
373
|
default: 'str',
|
|
351
374
|
types: ['json', 'str']
|
|
352
375
|
})
|
|
376
|
+
|
|
377
|
+
applyAdvertiserRecommendation('#node-config-input-advertiser')
|
|
378
|
+
|
|
379
|
+
if (RED.NRCHKBPairingQR) {
|
|
380
|
+
RED.NRCHKBPairingQR.renderHostEditor(
|
|
381
|
+
node.id,
|
|
382
|
+
'#nrchkb-standalone-pairing-qr',
|
|
383
|
+
)
|
|
384
|
+
}
|
|
353
385
|
},
|
|
354
386
|
})
|
|
355
387
|
</script>
|
|
@@ -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.STANDALONE);
|
|
29
|
+
log.debug("Registering homekit-standalone type");
|
|
30
|
+
RED.nodes.registerType("homekit-standalone", HAPHostNode.init);
|
|
13
31
|
};
|
package/build/nodes/status.html
CHANGED
|
@@ -1,22 +1,48 @@
|
|
|
1
1
|
<!--suppress EqualityComparisonWithCoercionJS -->
|
|
2
2
|
<script data-template-name="homekit-status" type="text/x-red">
|
|
3
|
-
<div class="
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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/
|
|
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
|
-
|
|
102
|
-
|
|
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
|
-
|