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
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
"use strict";
|
|
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 __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var registry_exports = {};
|
|
30
|
+
__export(registry_exports, {
|
|
31
|
+
NRCHKB_NODE_RED_PLUGIN_TYPE: () => NRCHKB_NODE_RED_PLUGIN_TYPE,
|
|
32
|
+
clearPluginsForTest: () => clearPluginsForTest,
|
|
33
|
+
getPlugin: () => getPlugin,
|
|
34
|
+
listPlugins: () => listPlugins,
|
|
35
|
+
normalizePluginId: () => normalizePluginId,
|
|
36
|
+
registerNodeRedPlugins: () => registerNodeRedPlugins,
|
|
37
|
+
registerPlugin: () => registerPlugin,
|
|
38
|
+
registerPluginFromModule: () => registerPluginFromModule,
|
|
39
|
+
registerPluginFromPackage: () => registerPluginFromPackage,
|
|
40
|
+
validatePluginMetadata: () => validatePluginMetadata
|
|
41
|
+
});
|
|
42
|
+
module.exports = __toCommonJS(registry_exports);
|
|
43
|
+
var import_node_fs = __toESM(require("node:fs"));
|
|
44
|
+
var import_node_path = __toESM(require("node:path"));
|
|
45
|
+
var import_node_url = require("node:url");
|
|
46
|
+
const NRCHKB_NODE_RED_PLUGIN_TYPE = "nrchkb-homekit-plugin";
|
|
47
|
+
const registry = /* @__PURE__ */ new Map();
|
|
48
|
+
const normalizePluginId = (packageName, pluginName) => `${packageName}:${pluginName}`;
|
|
49
|
+
const assertNonEmpty = (field, value) => {
|
|
50
|
+
if (typeof value !== "string" || value.trim().length === 0) {
|
|
51
|
+
throw new Error(`Plugin metadata field "${field}" is required.`);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const validatePluginMetadata = (metadata) => {
|
|
55
|
+
assertNonEmpty("packageName", metadata.packageName);
|
|
56
|
+
assertNonEmpty("pluginName", metadata.pluginName);
|
|
57
|
+
assertNonEmpty("displayName", metadata.displayName);
|
|
58
|
+
assertNonEmpty("author", metadata.author);
|
|
59
|
+
assertNonEmpty("version", metadata.version);
|
|
60
|
+
assertNonEmpty("description", metadata.description);
|
|
61
|
+
if (!metadata.capabilities || typeof metadata.capabilities !== "object") {
|
|
62
|
+
throw new Error('Plugin metadata field "capabilities" is required.');
|
|
63
|
+
}
|
|
64
|
+
if (metadata.prerequisites?.serviceNames && (!Array.isArray(metadata.prerequisites.serviceNames) || metadata.prerequisites.serviceNames.some(
|
|
65
|
+
(serviceName) => typeof serviceName !== "string" || serviceName.trim().length === 0
|
|
66
|
+
))) {
|
|
67
|
+
throw new Error(
|
|
68
|
+
"Plugin metadata prerequisites.serviceNames must be an array of service names."
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
if (metadata.serviceNames) {
|
|
72
|
+
if (!Array.isArray(metadata.serviceNames) || metadata.serviceNames.some(
|
|
73
|
+
(serviceName) => typeof serviceName !== "string" || serviceName.trim().length === 0
|
|
74
|
+
)) {
|
|
75
|
+
throw new Error(
|
|
76
|
+
"Plugin metadata serviceNames must be an array of service names."
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (metadata.attachment && !["inline", "config-node"].includes(metadata.attachment)) {
|
|
81
|
+
throw new Error(
|
|
82
|
+
'Plugin metadata attachment must be "inline" or "config-node".'
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
if (metadata.editor && (!Array.isArray(metadata.editor.sections) || metadata.editor.sections.some(
|
|
86
|
+
(section) => section.title !== void 0 && typeof section.title !== "string" || section.description !== void 0 && typeof section.description !== "string" || section.icon !== void 0 && typeof section.icon !== "string" || section.collapsed !== void 0 && typeof section.collapsed !== "boolean" || !Array.isArray(section.fields) || section.fields.some(
|
|
87
|
+
(field) => typeof field.path !== "string" || field.path.trim().length === 0 || typeof field.label !== "string" || field.label.trim().length === 0 || ![
|
|
88
|
+
"text",
|
|
89
|
+
"number",
|
|
90
|
+
"checkbox",
|
|
91
|
+
"select",
|
|
92
|
+
"password",
|
|
93
|
+
"textarea",
|
|
94
|
+
"config-node",
|
|
95
|
+
"dynamic-select"
|
|
96
|
+
].includes(field.type)
|
|
97
|
+
)
|
|
98
|
+
))) {
|
|
99
|
+
throw new Error(
|
|
100
|
+
"Plugin metadata editor.sections must contain valid editor field definitions."
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
const expectedId = normalizePluginId(
|
|
104
|
+
metadata.packageName,
|
|
105
|
+
metadata.pluginName
|
|
106
|
+
);
|
|
107
|
+
if (metadata.id !== expectedId) {
|
|
108
|
+
throw new Error(
|
|
109
|
+
`Plugin id "${metadata.id}" must match normalized id "${expectedId}".`
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
return {
|
|
113
|
+
...metadata,
|
|
114
|
+
attachment: metadata.attachment ?? "inline"
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
const registerPlugin = (metadata, factory) => {
|
|
118
|
+
const validMetadata = validatePluginMetadata(metadata);
|
|
119
|
+
if (registry.has(validMetadata.id)) {
|
|
120
|
+
throw new Error(`Plugin "${validMetadata.id}" is already registered.`);
|
|
121
|
+
}
|
|
122
|
+
const plugin = {
|
|
123
|
+
metadata: validMetadata,
|
|
124
|
+
factory
|
|
125
|
+
};
|
|
126
|
+
registry.set(validMetadata.id, plugin);
|
|
127
|
+
return plugin;
|
|
128
|
+
};
|
|
129
|
+
const registerPluginFromPackage = (packageJson, metadata, factory) => {
|
|
130
|
+
const packageName = metadata.packageName ?? packageJson.name;
|
|
131
|
+
const version = metadata.version ?? packageJson.version;
|
|
132
|
+
if (!packageName) {
|
|
133
|
+
throw new Error("Plugin packageName could not be resolved.");
|
|
134
|
+
}
|
|
135
|
+
if (!version) {
|
|
136
|
+
throw new Error("Plugin version could not be resolved.");
|
|
137
|
+
}
|
|
138
|
+
return registerPlugin(
|
|
139
|
+
{
|
|
140
|
+
...metadata,
|
|
141
|
+
packageName,
|
|
142
|
+
version,
|
|
143
|
+
id: metadata.id ?? normalizePluginId(packageName, metadata.pluginName)
|
|
144
|
+
},
|
|
145
|
+
factory
|
|
146
|
+
);
|
|
147
|
+
};
|
|
148
|
+
const findNearestPackageJson = (startFile) => {
|
|
149
|
+
let current = import_node_path.default.dirname(startFile);
|
|
150
|
+
while (current !== import_node_path.default.dirname(current)) {
|
|
151
|
+
const candidate = import_node_path.default.join(current, "package.json");
|
|
152
|
+
if (import_node_fs.default.existsSync(candidate)) {
|
|
153
|
+
return JSON.parse(import_node_fs.default.readFileSync(candidate, "utf8"));
|
|
154
|
+
}
|
|
155
|
+
current = import_node_path.default.dirname(current);
|
|
156
|
+
}
|
|
157
|
+
throw new Error(`Could not find package.json for ${startFile}.`);
|
|
158
|
+
};
|
|
159
|
+
const registerPluginFromModule = (importMetaUrl, metadata, factory) => {
|
|
160
|
+
const modulePath = (0, import_node_url.fileURLToPath)(importMetaUrl);
|
|
161
|
+
const packageJson = findNearestPackageJson(modulePath);
|
|
162
|
+
if (metadata.packageName && metadata.packageName !== packageJson.name) {
|
|
163
|
+
throw new Error(
|
|
164
|
+
`Plugin packageName "${metadata.packageName}" does not match nearest package "${packageJson.name}".`
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
return registerPluginFromPackage(packageJson, metadata, factory);
|
|
168
|
+
};
|
|
169
|
+
const getPlugin = (id) => registry.get(id);
|
|
170
|
+
const listPlugins = () => Array.from(registry.values());
|
|
171
|
+
const registerNodeRedPlugins = (RED) => {
|
|
172
|
+
const nodeRedPlugins = RED?.plugins?.getPluginsByType?.(
|
|
173
|
+
NRCHKB_NODE_RED_PLUGIN_TYPE
|
|
174
|
+
);
|
|
175
|
+
nodeRedPlugins?.forEach((definition) => {
|
|
176
|
+
if (definition.type !== NRCHKB_NODE_RED_PLUGIN_TYPE || !definition.metadata || !definition.factory || registry.has(definition.metadata.id)) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
try {
|
|
180
|
+
registerPlugin(definition.metadata, definition.factory);
|
|
181
|
+
} catch (error) {
|
|
182
|
+
RED?.log?.warn?.(
|
|
183
|
+
`Skipping NRCHKB plugin "${definition.metadata.id}" because registration failed: ${error}`
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
};
|
|
188
|
+
const clearPluginsForTest = () => {
|
|
189
|
+
registry.clear();
|
|
190
|
+
};
|
|
191
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
192
|
+
0 && (module.exports = {
|
|
193
|
+
NRCHKB_NODE_RED_PLUGIN_TYPE,
|
|
194
|
+
clearPluginsForTest,
|
|
195
|
+
getPlugin,
|
|
196
|
+
listPlugins,
|
|
197
|
+
normalizePluginId,
|
|
198
|
+
registerNodeRedPlugins,
|
|
199
|
+
registerPlugin,
|
|
200
|
+
registerPluginFromModule,
|
|
201
|
+
registerPluginFromPackage,
|
|
202
|
+
validatePluginMetadata
|
|
203
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var types_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(types_exports);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var import_node_fs = require("node:fs");
|
|
4
|
+
var import_node_path = require("node:path");
|
|
5
|
+
var import_HomeKitService2Migration = require("../lib/migration/HomeKitService2Migration");
|
|
6
|
+
const usage = () => {
|
|
7
|
+
console.error(
|
|
8
|
+
"Usage: node build/scripts/migrate-homekit-service-flows.js <flow-file.json> [output-file.json]"
|
|
9
|
+
);
|
|
10
|
+
};
|
|
11
|
+
const parseFlowFile = (filePath) => {
|
|
12
|
+
const content = (0, import_node_fs.readFileSync)(filePath, "utf8");
|
|
13
|
+
return JSON.parse(content);
|
|
14
|
+
};
|
|
15
|
+
const migrate = (flowPath) => {
|
|
16
|
+
const parsed = parseFlowFile(flowPath);
|
|
17
|
+
if (!Array.isArray(parsed)) {
|
|
18
|
+
throw new Error(
|
|
19
|
+
"Flow file must contain a JSON array of Node-RED nodes."
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
return (0, import_HomeKitService2Migration.migrateHomeKitServiceFlow)(parsed);
|
|
23
|
+
};
|
|
24
|
+
const [, , inputPath, outputPath] = process.argv;
|
|
25
|
+
if (!inputPath) {
|
|
26
|
+
usage();
|
|
27
|
+
process.exitCode = 1;
|
|
28
|
+
} else {
|
|
29
|
+
try {
|
|
30
|
+
const inputFile = (0, import_node_path.resolve)(inputPath);
|
|
31
|
+
const result = migrate(inputFile);
|
|
32
|
+
const destination = outputPath ? (0, import_node_path.resolve)(outputPath) : inputFile;
|
|
33
|
+
(0, import_node_fs.writeFileSync)(
|
|
34
|
+
destination,
|
|
35
|
+
`${JSON.stringify(result.nodes, null, 4)}
|
|
36
|
+
`,
|
|
37
|
+
"utf8"
|
|
38
|
+
);
|
|
39
|
+
console.log(
|
|
40
|
+
`Migrated ${result.migrated} homekit-service node(s), including ${result.cameraMigrated} camera node(s); skipped ${result.skipped}.`
|
|
41
|
+
);
|
|
42
|
+
console.log(`Wrote ${destination}`);
|
|
43
|
+
} catch (error) {
|
|
44
|
+
console.error(error instanceof Error ? error.message : error);
|
|
45
|
+
process.exitCode = 1;
|
|
46
|
+
}
|
|
47
|
+
}
|