node-red-contrib-homekit-bridged 2.0.0-dev.5 → 2.0.0-dev.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lib/HAPHostNode.js +183 -141
- package/build/lib/HAPServiceNode.js +199 -172
- package/build/lib/HAPServiceNode2.js +207 -172
- package/build/lib/NRCHKBError.js +23 -2
- package/build/lib/PairingQRCode.js +62 -0
- package/build/lib/Storage.js +157 -92
- package/build/lib/api.js +654 -288
- package/build/lib/camera/CameraControl.js +119 -84
- package/build/lib/camera/CameraDelegate.js +481 -404
- package/build/lib/camera/MP4StreamingServer.js +148 -139
- package/build/lib/hap/HAPCharacteristic.js +25 -4
- package/build/lib/hap/HAPService.js +25 -4
- package/build/lib/hap/eve-app/EveCharacteristics.js +124 -81
- package/build/lib/hap/eve-app/EveServices.js +50 -17
- package/build/lib/hap/hap-nodejs.js +32 -0
- package/build/lib/migration/HomeKitService2Migration.js +34 -0
- package/build/lib/migration/NodeMigration.js +75 -0
- package/build/lib/types/AccessoryInformationType.js +15 -1
- package/build/lib/types/CameraConfigType.js +15 -1
- package/build/lib/types/CustomCharacteristicType.js +15 -1
- package/build/lib/types/HAPHostConfigType.js +15 -1
- package/build/lib/types/HAPHostNodeType.js +15 -1
- package/build/lib/types/HAPService2ConfigType.js +15 -1
- package/build/lib/types/HAPService2NodeType.js +15 -1
- package/build/lib/types/HAPServiceConfigType.js +15 -1
- package/build/lib/types/HAPServiceNodeType.js +15 -1
- package/build/lib/types/HAPStatusConfigType.js +15 -1
- package/build/lib/types/HAPStatusNodeType.js +15 -1
- package/build/lib/types/HostType.js +28 -7
- package/build/lib/types/NodeType.js +15 -1
- package/build/lib/types/PublishTimersType.js +15 -1
- package/build/lib/types/UniFiControllerConfigType.js +16 -0
- package/build/lib/types/hap-nodejs/HapAdaptiveLightingControllerMode.js +28 -7
- package/build/lib/types/hap-nodejs/HapCategories.js +64 -43
- package/build/lib/types/storage/SerializedHostType.js +15 -1
- package/build/lib/types/storage/StorageType.js +34 -10
- package/build/lib/unifi/ProtectDiscovery.js +80 -0
- package/build/lib/utils/AccessoryUtils.js +152 -110
- package/build/lib/utils/BridgeUtils.js +82 -39
- package/build/lib/utils/CharacteristicUtils.js +5 -49
- package/build/lib/utils/CharacteristicUtils2.js +5 -49
- package/build/lib/utils/CharacteristicUtilsBase.js +81 -0
- package/build/lib/utils/NodeStatusUtils.js +89 -40
- package/build/lib/utils/ServiceUtils.js +434 -375
- package/build/lib/utils/ServiceUtils2.js +514 -309
- package/build/lib/utils/index.js +10 -11
- package/build/nodes/bridge.html +184 -166
- package/build/nodes/bridge.js +27 -9
- package/build/nodes/locales/en-US/node-red-contrib-homekit-bridged.json +22 -0
- package/build/nodes/nrchkb.html +1601 -88
- package/build/nodes/nrchkb.js +66 -88
- package/build/nodes/plugin-instance.html +499 -0
- package/build/nodes/plugin-instance.js +46 -0
- package/build/nodes/service.html +517 -299
- package/build/nodes/service.js +5 -6
- package/build/nodes/service2.html +1683 -460
- package/build/nodes/service2.js +5 -8
- package/build/nodes/standalone.html +187 -174
- package/build/nodes/standalone.js +27 -9
- package/build/nodes/status.html +51 -18
- package/build/nodes/status.js +47 -40
- package/build/nodes/unifi-controller.html +92 -0
- package/build/nodes/unifi-controller.js +20 -0
- package/build/plugins/embedded/homebridge-camera-ffmpeg/index.js +479 -0
- package/build/plugins/embedded/homebridge-unifi-protect/index.js +521 -0
- package/build/plugins/embedded/index.js +58 -0
- package/build/plugins/nrchkb-homekit-plugins.js +17 -0
- package/build/plugins/registry/index.js +203 -0
- package/build/plugins/registry/types.js +16 -0
- package/build/scripts/migrate-homekit-service-flows.js +47 -0
- package/examples/demo/01 - ALL Demos single import.json +1885 -1885
- package/examples/demo/02 - Air Purifier.json +279 -279
- package/examples/demo/03 - Air Quality sensor with Battery.json +254 -254
- package/examples/demo/04 - Dimmable Bulb.json +172 -172
- package/examples/demo/05 - Color Bulb (HSV).json +195 -195
- package/examples/demo/06 - Fan (simple, 3 speeds).json +240 -240
- package/examples/demo/07 - Fan (with speed, oscillate, rotation direction).json +175 -175
- package/examples/demo/08 - CO2 detector.json +224 -224
- package/examples/demo/09 - CO (carbon monoxide) example.json +255 -255
- package/examples/demo/10 - Door window contact sensor.json +234 -234
- package/examples/demos (advanced)/01 - Television with inputs and speaker.json +541 -541
- package/examples/switch/01 - Plain Switch.json +178 -178
- package/package.json +95 -84
- package/build/lib/HAPHostNode.d.ts +0 -1
- package/build/lib/HAPServiceNode.d.ts +0 -1
- package/build/lib/HAPServiceNode2.d.ts +0 -1
- package/build/lib/NRCHKBError.d.ts +0 -3
- package/build/lib/Storage.d.ts +0 -30
- package/build/lib/api.d.ts +0 -1
- package/build/lib/camera/CameraControl.d.ts +0 -3
- package/build/lib/camera/CameraDelegate.d.ts +0 -38
- package/build/lib/camera/MP4StreamingServer.d.ts +0 -26
- package/build/lib/hap/HAPCharacteristic.d.ts +0 -9
- package/build/lib/hap/HAPService.d.ts +0 -6
- package/build/lib/hap/eve-app/EveCharacteristics.d.ts +0 -20
- package/build/lib/hap/eve-app/EveServices.d.ts +0 -5
- package/build/lib/types/AccessoryInformationType.d.ts +0 -11
- package/build/lib/types/CameraConfigType.d.ts +0 -24
- package/build/lib/types/CustomCharacteristicType.d.ts +0 -6
- package/build/lib/types/HAPHostConfigType.d.ts +0 -22
- package/build/lib/types/HAPHostNodeType.d.ts +0 -14
- package/build/lib/types/HAPService2ConfigType.d.ts +0 -6
- package/build/lib/types/HAPService2NodeType.d.ts +0 -7
- package/build/lib/types/HAPServiceConfigType.d.ts +0 -26
- package/build/lib/types/HAPServiceNodeType.d.ts +0 -38
- package/build/lib/types/HAPStatusConfigType.d.ts +0 -5
- package/build/lib/types/HAPStatusNodeType.d.ts +0 -12
- package/build/lib/types/HostType.d.ts +0 -5
- package/build/lib/types/NodeType.d.ts +0 -3
- package/build/lib/types/PublishTimersType.d.ts +0 -4
- package/build/lib/types/hap-nodejs/HapAdaptiveLightingControllerMode.d.ts +0 -5
- package/build/lib/types/hap-nodejs/HapCategories.d.ts +0 -41
- package/build/lib/types/storage/SerializedHostType.d.ts +0 -5
- package/build/lib/types/storage/StorageType.d.ts +0 -8
- package/build/lib/utils/AccessoryUtils.d.ts +0 -1
- package/build/lib/utils/BridgeUtils.d.ts +0 -1
- package/build/lib/utils/CharacteristicUtils.d.ts +0 -1
- package/build/lib/utils/CharacteristicUtils2.d.ts +0 -1
- package/build/lib/utils/NodeStatusUtils.d.ts +0 -17
- package/build/lib/utils/ServiceUtils.d.ts +0 -1
- package/build/lib/utils/ServiceUtils2.d.ts +0 -1
- package/build/lib/utils/index.d.ts +0 -1
- package/build/nodes/bridge.d.ts +0 -1
- package/build/nodes/nrchkb.d.ts +0 -1
- package/build/nodes/service.d.ts +0 -1
- package/build/nodes/service2.d.ts +0 -1
- package/build/nodes/standalone.d.ts +0 -1
- package/build/nodes/status.d.ts +0 -1
|
@@ -1,90 +1,125 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var CameraControl_exports = {};
|
|
20
|
+
__export(CameraControl_exports, {
|
|
21
|
+
configureCamera: () => configureCamera
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(CameraControl_exports);
|
|
24
|
+
var import_hap_nodejs = require("@homebridge/hap-nodejs");
|
|
25
|
+
var import_CameraDelegate = require("./CameraDelegate");
|
|
6
26
|
const configureCamera = (accessory, config) => {
|
|
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
|
-
|
|
27
|
+
const streamDelegate = new import_CameraDelegate.CameraDelegate(accessory, config);
|
|
28
|
+
const cameraController = new import_hap_nodejs.CameraController({
|
|
29
|
+
cameraStreamCount: Math.max(1, config?.cameraConfigMaxStreams || 2),
|
|
30
|
+
// default 2
|
|
31
|
+
delegate: streamDelegate,
|
|
32
|
+
streamingOptions: {
|
|
33
|
+
// srtp: true, // legacy option which will just enable AES_CM_128_HMAC_SHA1_80 (can still be used though)
|
|
34
|
+
// iOS does not support NONE just there for testing with Wireshark, for example
|
|
35
|
+
supportedCryptoSuites: [
|
|
36
|
+
import_hap_nodejs.SRTPCryptoSuites.NONE,
|
|
37
|
+
import_hap_nodejs.SRTPCryptoSuites.AES_CM_128_HMAC_SHA1_80
|
|
38
|
+
],
|
|
39
|
+
video: {
|
|
40
|
+
codec: {
|
|
41
|
+
profiles: [
|
|
42
|
+
import_hap_nodejs.H264Profile.BASELINE,
|
|
43
|
+
import_hap_nodejs.H264Profile.MAIN,
|
|
44
|
+
import_hap_nodejs.H264Profile.HIGH
|
|
45
|
+
],
|
|
46
|
+
levels: [
|
|
47
|
+
import_hap_nodejs.H264Level.LEVEL3_1,
|
|
48
|
+
import_hap_nodejs.H264Level.LEVEL3_2,
|
|
49
|
+
import_hap_nodejs.H264Level.LEVEL4_0
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
resolutions: (() => {
|
|
53
|
+
const maxW = config?.cameraConfigMaxWidth;
|
|
54
|
+
const maxH = config?.cameraConfigMaxHeight;
|
|
55
|
+
const maxFps = config?.cameraConfigMaxFPS;
|
|
56
|
+
const defaults = [
|
|
57
|
+
[1920, 1080, 30],
|
|
58
|
+
[1280, 960, 30],
|
|
59
|
+
[1280, 720, 30],
|
|
60
|
+
[1024, 768, 30],
|
|
61
|
+
[640, 480, 30],
|
|
62
|
+
[640, 360, 30],
|
|
63
|
+
[480, 360, 30],
|
|
64
|
+
[480, 270, 30],
|
|
65
|
+
[320, 240, 30],
|
|
66
|
+
[320, 240, 15],
|
|
67
|
+
[320, 180, 30]
|
|
68
|
+
];
|
|
69
|
+
return defaults.filter(
|
|
70
|
+
([w, h]) => (!maxW || w <= maxW) && (!maxH || h <= maxH)
|
|
71
|
+
).map(([w, h, f]) => [w, h, Math.min(f, maxFps || f)]);
|
|
72
|
+
})()
|
|
73
|
+
}
|
|
74
|
+
// audio options intentionally omitted here; delegate will honor config for RTP audio path
|
|
75
|
+
},
|
|
76
|
+
recording: {
|
|
77
|
+
options: {
|
|
78
|
+
prebufferLength: 4e3,
|
|
79
|
+
mediaContainerConfiguration: {
|
|
80
|
+
type: import_hap_nodejs.MediaContainerType.FRAGMENTED_MP4,
|
|
81
|
+
fragmentLength: 4e3
|
|
43
82
|
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
[640, 360, 30],
|
|
64
|
-
[640, 480, 30],
|
|
65
|
-
[1280, 720, 30],
|
|
66
|
-
[1280, 960, 30],
|
|
67
|
-
[1920, 1080, 30],
|
|
68
|
-
[1600, 1200, 30]
|
|
69
|
-
]
|
|
70
|
-
},
|
|
71
|
-
audio: {
|
|
72
|
-
codecs: {
|
|
73
|
-
type: 1,
|
|
74
|
-
audioChannels: 1,
|
|
75
|
-
samplerate: 5,
|
|
76
|
-
bitrateMode: 0
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
delegate: streamDelegate
|
|
83
|
+
video: {
|
|
84
|
+
type: import_hap_nodejs.VideoCodecType.H264,
|
|
85
|
+
parameters: {
|
|
86
|
+
profiles: [import_hap_nodejs.H264Profile.HIGH],
|
|
87
|
+
levels: [import_hap_nodejs.H264Level.LEVEL4_0]
|
|
88
|
+
},
|
|
89
|
+
resolutions: [
|
|
90
|
+
[320, 180, 30],
|
|
91
|
+
[320, 240, 15],
|
|
92
|
+
[320, 240, 30],
|
|
93
|
+
[480, 270, 30],
|
|
94
|
+
[480, 360, 30],
|
|
95
|
+
[640, 360, 30],
|
|
96
|
+
[640, 480, 30],
|
|
97
|
+
[1280, 720, 30],
|
|
98
|
+
[1280, 960, 30],
|
|
99
|
+
[1920, 1080, 30],
|
|
100
|
+
[1600, 1200, 30]
|
|
101
|
+
]
|
|
81
102
|
},
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
103
|
+
audio: {
|
|
104
|
+
codecs: {
|
|
105
|
+
type: import_hap_nodejs.AudioRecordingCodecType.AAC_ELD,
|
|
106
|
+
audioChannels: 1,
|
|
107
|
+
samplerate: import_hap_nodejs.AudioRecordingSamplerate.KHZ_48,
|
|
108
|
+
bitrateMode: import_hap_nodejs.AudioBitrate.VARIABLE
|
|
109
|
+
}
|
|
85
110
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
111
|
+
},
|
|
112
|
+
delegate: streamDelegate
|
|
113
|
+
},
|
|
114
|
+
sensors: {
|
|
115
|
+
motion: true,
|
|
116
|
+
occupancy: true
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
streamDelegate.controller = cameraController;
|
|
120
|
+
accessory.configureController(cameraController);
|
|
89
121
|
};
|
|
90
|
-
|
|
122
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
123
|
+
0 && (module.exports = {
|
|
124
|
+
configureCamera
|
|
125
|
+
});
|