homebridge 2.0.0-alpha.4 → 2.0.0-alpha.5
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/bin/homebridge +1 -1
- package/dist/api.d.ts +193 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +129 -0
- package/dist/api.js.map +1 -0
- package/dist/bridgeService.d.ts +106 -0
- package/dist/bridgeService.d.ts.map +1 -0
- package/dist/bridgeService.js +390 -0
- package/dist/bridgeService.js.map +1 -0
- package/dist/childBridgeFork.d.ts +38 -0
- package/dist/childBridgeFork.d.ts.map +1 -0
- package/dist/childBridgeFork.js +241 -2
- package/dist/childBridgeFork.js.map +1 -7
- package/dist/childBridgeService.d.ts +200 -0
- package/dist/childBridgeService.d.ts.map +1 -0
- package/dist/childBridgeService.js +427 -0
- package/dist/childBridgeService.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +89 -2
- package/dist/cli.js.map +1 -7
- package/dist/externalPortService.d.ts +33 -0
- package/dist/externalPortService.d.ts.map +1 -0
- package/dist/externalPortService.js +59 -0
- package/dist/externalPortService.js.map +1 -0
- package/dist/index.d.ts +76 -1099
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -2
- package/dist/index.js.map +1 -7
- package/dist/ipcService.d.ts +30 -0
- package/dist/ipcService.d.ts.map +1 -0
- package/dist/ipcService.js +49 -0
- package/dist/ipcService.js.map +1 -0
- package/dist/logger.d.ts +78 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +138 -0
- package/dist/logger.js.map +1 -0
- package/dist/platformAccessory.d.ts +55 -0
- package/dist/platformAccessory.d.ts.map +1 -0
- package/dist/platformAccessory.js +98 -0
- package/dist/platformAccessory.js.map +1 -0
- package/dist/plugin.d.ts +31 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +185 -0
- package/dist/plugin.js.map +1 -0
- package/dist/pluginManager.d.ts +77 -0
- package/dist/pluginManager.d.ts.map +1 -0
- package/dist/pluginManager.js +374 -0
- package/dist/pluginManager.js.map +1 -0
- package/dist/server.d.ts +58 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +430 -0
- package/dist/server.js.map +1 -0
- package/dist/storageService.d.ts +13 -0
- package/dist/storageService.d.ts.map +1 -0
- package/dist/storageService.js +41 -0
- package/dist/storageService.js.map +1 -0
- package/dist/user.d.ts +13 -0
- package/dist/user.d.ts.map +1 -0
- package/dist/user.js +29 -0
- package/dist/user.js.map +1 -0
- package/dist/util/mac.d.ts +5 -0
- package/dist/util/mac.d.ts.map +1 -0
- package/dist/util/mac.js +14 -0
- package/dist/util/mac.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +16 -0
- package/dist/version.js.map +1 -0
- package/package.json +7 -10
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
import child_process from 'node:child_process';
|
|
2
|
+
import path, { dirname } from 'node:path';
|
|
3
|
+
import process from 'node:process';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import fs from 'fs-extra';
|
|
6
|
+
import { Logger } from './logger.js';
|
|
7
|
+
import { User } from './user.js';
|
|
8
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
9
|
+
const __dirname = dirname(__filename);
|
|
10
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
11
|
+
export var ChildProcessMessageEventType;
|
|
12
|
+
(function (ChildProcessMessageEventType) {
|
|
13
|
+
/**
|
|
14
|
+
* Sent from the child process when it is ready to accept config
|
|
15
|
+
*/
|
|
16
|
+
ChildProcessMessageEventType["READY"] = "ready";
|
|
17
|
+
/**
|
|
18
|
+
* Sent to the child process with a ChildProcessLoadEventData payload
|
|
19
|
+
*/
|
|
20
|
+
ChildProcessMessageEventType["LOAD"] = "load";
|
|
21
|
+
/**
|
|
22
|
+
* Sent from the child process once it has loaded the plugin
|
|
23
|
+
*/
|
|
24
|
+
ChildProcessMessageEventType["LOADED"] = "loaded";
|
|
25
|
+
/**
|
|
26
|
+
* Sent to the child process telling it to start
|
|
27
|
+
*/
|
|
28
|
+
ChildProcessMessageEventType["START"] = "start";
|
|
29
|
+
/**
|
|
30
|
+
* Sent from the child process when the bridge is online
|
|
31
|
+
*/
|
|
32
|
+
ChildProcessMessageEventType["ONLINE"] = "online";
|
|
33
|
+
/**
|
|
34
|
+
* Sent from the child when it wants to request port allocation for an external accessory
|
|
35
|
+
*/
|
|
36
|
+
ChildProcessMessageEventType["PORT_REQUEST"] = "portRequest";
|
|
37
|
+
/**
|
|
38
|
+
* Sent from the parent with the port allocation response
|
|
39
|
+
*/
|
|
40
|
+
ChildProcessMessageEventType["PORT_ALLOCATED"] = "portAllocated";
|
|
41
|
+
/**
|
|
42
|
+
* Sent from the child to update its current status
|
|
43
|
+
*/
|
|
44
|
+
ChildProcessMessageEventType["STATUS_UPDATE"] = "status";
|
|
45
|
+
})(ChildProcessMessageEventType || (ChildProcessMessageEventType = {}));
|
|
46
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
47
|
+
export var ChildBridgeStatus;
|
|
48
|
+
(function (ChildBridgeStatus) {
|
|
49
|
+
/**
|
|
50
|
+
* When the child bridge is loading, or restarting
|
|
51
|
+
*/
|
|
52
|
+
ChildBridgeStatus["PENDING"] = "pending";
|
|
53
|
+
/**
|
|
54
|
+
* The child bridge is online and has published it's accessory
|
|
55
|
+
*/
|
|
56
|
+
ChildBridgeStatus["OK"] = "ok";
|
|
57
|
+
/**
|
|
58
|
+
* The bridge is shutting down, or the process ended unexpectedly
|
|
59
|
+
*/
|
|
60
|
+
ChildBridgeStatus["DOWN"] = "down";
|
|
61
|
+
})(ChildBridgeStatus || (ChildBridgeStatus = {}));
|
|
62
|
+
/**
|
|
63
|
+
* Manages the child processes of platforms/accessories being exposed as separate forked bridges.
|
|
64
|
+
* A child bridge runs a single platform or accessory.
|
|
65
|
+
*/
|
|
66
|
+
export class ChildBridgeService {
|
|
67
|
+
type;
|
|
68
|
+
identifier;
|
|
69
|
+
plugin;
|
|
70
|
+
bridgeConfig;
|
|
71
|
+
homebridgeConfig;
|
|
72
|
+
homebridgeOptions;
|
|
73
|
+
api;
|
|
74
|
+
ipcService;
|
|
75
|
+
externalPortService;
|
|
76
|
+
child;
|
|
77
|
+
args = [];
|
|
78
|
+
processEnv = {};
|
|
79
|
+
shuttingDown = false;
|
|
80
|
+
lastBridgeStatus = "pending" /* ChildBridgeStatus.PENDING */;
|
|
81
|
+
pairedStatus = null;
|
|
82
|
+
manuallyStopped = false;
|
|
83
|
+
setupUri = null;
|
|
84
|
+
pluginConfig = [];
|
|
85
|
+
log;
|
|
86
|
+
displayName;
|
|
87
|
+
constructor(type, identifier, plugin, bridgeConfig, homebridgeConfig, homebridgeOptions, api, ipcService, externalPortService) {
|
|
88
|
+
this.type = type;
|
|
89
|
+
this.identifier = identifier;
|
|
90
|
+
this.plugin = plugin;
|
|
91
|
+
this.bridgeConfig = bridgeConfig;
|
|
92
|
+
this.homebridgeConfig = homebridgeConfig;
|
|
93
|
+
this.homebridgeOptions = homebridgeOptions;
|
|
94
|
+
this.api = api;
|
|
95
|
+
this.ipcService = ipcService;
|
|
96
|
+
this.externalPortService = externalPortService;
|
|
97
|
+
this.log = Logger.withPrefix(this.plugin.getPluginIdentifier());
|
|
98
|
+
this.api.on('shutdown', () => {
|
|
99
|
+
this.shuttingDown = true;
|
|
100
|
+
this.teardown();
|
|
101
|
+
});
|
|
102
|
+
// make sure we don't hit the max listeners limit
|
|
103
|
+
this.api.setMaxListeners(this.api.getMaxListeners() + 1);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Start the child bridge service
|
|
107
|
+
*/
|
|
108
|
+
start() {
|
|
109
|
+
this.setProcessFlags();
|
|
110
|
+
this.setProcessEnv();
|
|
111
|
+
this.startChildProcess();
|
|
112
|
+
// set display name
|
|
113
|
+
if (this.pluginConfig.length > 1 || this.pluginConfig.length === 0) {
|
|
114
|
+
this.displayName = this.plugin.getPluginIdentifier();
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
this.displayName = this.pluginConfig[0]?.name || this.plugin.getPluginIdentifier();
|
|
118
|
+
}
|
|
119
|
+
// re-configured log with display name
|
|
120
|
+
this.log = Logger.withPrefix(this.displayName);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Add a config block to a child bridge.
|
|
124
|
+
* Platform child bridges can only contain one config block.
|
|
125
|
+
* @param config
|
|
126
|
+
*/
|
|
127
|
+
addConfig(config) {
|
|
128
|
+
this.pluginConfig.push(config);
|
|
129
|
+
}
|
|
130
|
+
get bridgeStatus() {
|
|
131
|
+
return this.lastBridgeStatus;
|
|
132
|
+
}
|
|
133
|
+
set bridgeStatus(value) {
|
|
134
|
+
this.lastBridgeStatus = value;
|
|
135
|
+
this.sendStatusUpdate();
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Start the child bridge process
|
|
139
|
+
*/
|
|
140
|
+
startChildProcess() {
|
|
141
|
+
this.bridgeStatus = "pending" /* ChildBridgeStatus.PENDING */;
|
|
142
|
+
this.child = child_process.fork(path.resolve(__dirname, 'childBridgeFork.js'), this.args, this.processEnv);
|
|
143
|
+
this.child.stdout?.on('data', (data) => {
|
|
144
|
+
process.stdout.write(data);
|
|
145
|
+
});
|
|
146
|
+
this.child.stderr?.on('data', (data) => {
|
|
147
|
+
process.stderr.write(data);
|
|
148
|
+
});
|
|
149
|
+
this.child.on('exit', () => {
|
|
150
|
+
this.log.warn('Child bridge process ended');
|
|
151
|
+
});
|
|
152
|
+
this.child.on('error', (e) => {
|
|
153
|
+
this.bridgeStatus = "down" /* ChildBridgeStatus.DOWN */;
|
|
154
|
+
this.log.error('Child process error', e);
|
|
155
|
+
});
|
|
156
|
+
this.child.once('close', (code, signal) => {
|
|
157
|
+
this.bridgeStatus = "down" /* ChildBridgeStatus.DOWN */;
|
|
158
|
+
this.handleProcessClose(code, signal);
|
|
159
|
+
});
|
|
160
|
+
// handle incoming ipc messages from the child process
|
|
161
|
+
this.child.on('message', (message) => {
|
|
162
|
+
if (typeof message !== 'object' || !message.id) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
switch (message.id) {
|
|
166
|
+
case "ready" /* ChildProcessMessageEventType.READY */: {
|
|
167
|
+
this.log(`Launched child bridge with PID ${this.child?.pid}`);
|
|
168
|
+
this.loadPlugin();
|
|
169
|
+
break;
|
|
170
|
+
}
|
|
171
|
+
case "loaded" /* ChildProcessMessageEventType.LOADED */: {
|
|
172
|
+
const version = message.data.version;
|
|
173
|
+
if (this.pluginConfig.length > 1) {
|
|
174
|
+
this.log(`Loaded ${this.plugin.getPluginIdentifier()} v${version} child bridge successfully with ${this.pluginConfig.length} accessories`);
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
this.log(`Loaded ${this.plugin.getPluginIdentifier()} v${version} child bridge successfully`);
|
|
178
|
+
}
|
|
179
|
+
this.startBridge();
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
case "online" /* ChildProcessMessageEventType.ONLINE */: {
|
|
183
|
+
this.bridgeStatus = "ok" /* ChildBridgeStatus.OK */;
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
case "portRequest" /* ChildProcessMessageEventType.PORT_REQUEST */: {
|
|
187
|
+
this.handlePortRequest(message.data);
|
|
188
|
+
break;
|
|
189
|
+
}
|
|
190
|
+
case "status" /* ChildProcessMessageEventType.STATUS_UPDATE */: {
|
|
191
|
+
this.pairedStatus = message.data.paired;
|
|
192
|
+
this.setupUri = message.data.setupUri;
|
|
193
|
+
this.sendStatusUpdate();
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Called when the child bridge process exits, if Homebridge is not shutting down, it will restart the process
|
|
201
|
+
* @param code
|
|
202
|
+
* @param signal
|
|
203
|
+
*/
|
|
204
|
+
handleProcessClose(code, signal) {
|
|
205
|
+
this.log(`Process Ended. Code: ${code}, Signal: ${signal}`);
|
|
206
|
+
setTimeout(() => {
|
|
207
|
+
if (!this.shuttingDown) {
|
|
208
|
+
this.log('Restarting Process...');
|
|
209
|
+
this.startChildProcess();
|
|
210
|
+
}
|
|
211
|
+
}, 7000);
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Helper function to send a message to the child process
|
|
215
|
+
* @param type
|
|
216
|
+
* @param data
|
|
217
|
+
*/
|
|
218
|
+
sendMessage(type, data) {
|
|
219
|
+
if (this.child && this.child.connected) {
|
|
220
|
+
this.child.send({
|
|
221
|
+
id: type,
|
|
222
|
+
data,
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Some plugins may make use of the homebridge process flags
|
|
228
|
+
* These will be passed through to the forked process
|
|
229
|
+
*/
|
|
230
|
+
setProcessFlags() {
|
|
231
|
+
if (this.homebridgeOptions.debugModeEnabled) {
|
|
232
|
+
this.args.push('-D');
|
|
233
|
+
}
|
|
234
|
+
if (this.homebridgeOptions.forceColourLogging) {
|
|
235
|
+
this.args.push('-C');
|
|
236
|
+
}
|
|
237
|
+
if (this.homebridgeOptions.insecureAccess) {
|
|
238
|
+
this.args.push('-I');
|
|
239
|
+
}
|
|
240
|
+
if (this.homebridgeOptions.noLogTimestamps) {
|
|
241
|
+
this.args.push('-T');
|
|
242
|
+
}
|
|
243
|
+
if (this.homebridgeOptions.keepOrphanedCachedAccessories) {
|
|
244
|
+
this.args.push('-K');
|
|
245
|
+
}
|
|
246
|
+
if (this.homebridgeOptions.customStoragePath) {
|
|
247
|
+
this.args.push('-U', this.homebridgeOptions.customStoragePath);
|
|
248
|
+
}
|
|
249
|
+
if (this.homebridgeOptions.customPluginPath) {
|
|
250
|
+
this.args.push('-P', this.homebridgeOptions.customPluginPath);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Set environment variables for the child process
|
|
255
|
+
*/
|
|
256
|
+
setProcessEnv() {
|
|
257
|
+
this.processEnv = {
|
|
258
|
+
env: {
|
|
259
|
+
...process.env,
|
|
260
|
+
DEBUG: `${process.env.DEBUG || ''} ${this.bridgeConfig.env?.DEBUG || ''}`.trim(),
|
|
261
|
+
NODE_OPTIONS: `${process.env.NODE_OPTIONS || ''} ${this.bridgeConfig.env?.NODE_OPTIONS || ''}`.trim(),
|
|
262
|
+
},
|
|
263
|
+
silent: true,
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Tell the child process to load the given plugin
|
|
268
|
+
*/
|
|
269
|
+
loadPlugin() {
|
|
270
|
+
const bridgeConfig = {
|
|
271
|
+
name: this.bridgeConfig.name || this.displayName || this.plugin.getPluginIdentifier(),
|
|
272
|
+
port: this.bridgeConfig.port,
|
|
273
|
+
username: this.bridgeConfig.username,
|
|
274
|
+
advertiser: this.homebridgeConfig.bridge.advertiser,
|
|
275
|
+
pin: this.bridgeConfig.pin || this.homebridgeConfig.bridge.pin,
|
|
276
|
+
bind: this.homebridgeConfig.bridge.bind,
|
|
277
|
+
setupID: this.bridgeConfig.setupID,
|
|
278
|
+
manufacturer: this.bridgeConfig.manufacturer || this.homebridgeConfig.bridge.manufacturer,
|
|
279
|
+
model: this.bridgeConfig.model || this.homebridgeConfig.bridge.model,
|
|
280
|
+
firmwareRevision: this.bridgeConfig.firmwareRevision || this.homebridgeConfig.bridge.firmwareRevision,
|
|
281
|
+
};
|
|
282
|
+
const bridgeOptions = {
|
|
283
|
+
cachedAccessoriesDir: User.cachedAccessoryPath(),
|
|
284
|
+
cachedAccessoriesItemName: `cachedAccessories.${this.bridgeConfig.username.replace(/:/g, '').toUpperCase()}`,
|
|
285
|
+
};
|
|
286
|
+
// shallow copy the homebridge options to the bridge options object
|
|
287
|
+
Object.assign(bridgeOptions, this.homebridgeOptions);
|
|
288
|
+
this.sendMessage("load" /* ChildProcessMessageEventType.LOAD */, {
|
|
289
|
+
type: this.type,
|
|
290
|
+
identifier: this.identifier,
|
|
291
|
+
pluginPath: this.plugin.getPluginPath(),
|
|
292
|
+
pluginConfig: this.pluginConfig,
|
|
293
|
+
bridgeConfig,
|
|
294
|
+
bridgeOptions,
|
|
295
|
+
homebridgeConfig: {
|
|
296
|
+
bridge: this.homebridgeConfig.bridge,
|
|
297
|
+
ports: this.homebridgeConfig.ports,
|
|
298
|
+
disabledPlugins: [], // not used by child bridges
|
|
299
|
+
accessories: [], // not used by child bridges
|
|
300
|
+
platforms: [], // not used by child bridges
|
|
301
|
+
},
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Tell the child bridge to start broadcasting
|
|
306
|
+
*/
|
|
307
|
+
startBridge() {
|
|
308
|
+
this.sendMessage("start" /* ChildProcessMessageEventType.START */);
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Handle external port requests from child
|
|
312
|
+
*/
|
|
313
|
+
async handlePortRequest(request) {
|
|
314
|
+
const port = await this.externalPortService.requestPort(request.username);
|
|
315
|
+
this.sendMessage("portAllocated" /* ChildProcessMessageEventType.PORT_ALLOCATED */, {
|
|
316
|
+
username: request.username,
|
|
317
|
+
port,
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Send sigterm to the child bridge
|
|
322
|
+
*/
|
|
323
|
+
teardown() {
|
|
324
|
+
if (this.child && this.child.connected) {
|
|
325
|
+
this.bridgeStatus = "down" /* ChildBridgeStatus.DOWN */;
|
|
326
|
+
this.child.kill('SIGTERM');
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Trigger sending child bridge metadata to the process parent via IPC
|
|
331
|
+
*/
|
|
332
|
+
sendStatusUpdate() {
|
|
333
|
+
this.ipcService.sendMessage("childBridgeStatusUpdate" /* IpcOutgoingEvent.CHILD_BRIDGE_STATUS_UPDATE */, this.getMetadata());
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Restarts the child bridge process
|
|
337
|
+
*/
|
|
338
|
+
restartChildBridge() {
|
|
339
|
+
if (this.manuallyStopped) {
|
|
340
|
+
this.startChildBridge();
|
|
341
|
+
}
|
|
342
|
+
else {
|
|
343
|
+
this.log.warn('Restarting child bridge...');
|
|
344
|
+
this.refreshConfig();
|
|
345
|
+
this.teardown();
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Stops the child bridge, not starting it again
|
|
350
|
+
*/
|
|
351
|
+
stopChildBridge() {
|
|
352
|
+
if (!this.shuttingDown) {
|
|
353
|
+
this.log.warn('Stopping child bridge (will not restart)...');
|
|
354
|
+
this.shuttingDown = true;
|
|
355
|
+
this.manuallyStopped = true;
|
|
356
|
+
this.child?.removeAllListeners('close');
|
|
357
|
+
this.teardown();
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
this.log.warn('Bridge already shutting down or stopped.');
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Starts the child bridge, only if it was manually stopped and is no longer running
|
|
365
|
+
*/
|
|
366
|
+
startChildBridge() {
|
|
367
|
+
if (this.manuallyStopped && this.bridgeStatus === "down" /* ChildBridgeStatus.DOWN */ && (!this.child || !this.child.connected)) {
|
|
368
|
+
this.log.warn('Starting child bridge...');
|
|
369
|
+
this.refreshConfig();
|
|
370
|
+
this.startChildProcess();
|
|
371
|
+
this.shuttingDown = false;
|
|
372
|
+
this.manuallyStopped = false;
|
|
373
|
+
}
|
|
374
|
+
else {
|
|
375
|
+
this.log.warn('Cannot start child bridge, it is still running or was not manually stopped');
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Read the config.json file from disk and refresh the plugin config block for just this plugin
|
|
380
|
+
*/
|
|
381
|
+
async refreshConfig() {
|
|
382
|
+
try {
|
|
383
|
+
const homebridgeConfig = await fs.readJson(User.configPath());
|
|
384
|
+
if (this.type === "platform" /* PluginType.PLATFORM */) {
|
|
385
|
+
const config = homebridgeConfig.platforms?.filter(x => x.platform === this.identifier && x._bridge?.username === this.bridgeConfig.username);
|
|
386
|
+
if (config.length) {
|
|
387
|
+
this.pluginConfig = config;
|
|
388
|
+
this.bridgeConfig = this.pluginConfig[0]._bridge || this.bridgeConfig;
|
|
389
|
+
}
|
|
390
|
+
else {
|
|
391
|
+
this.log.warn('Platform config could not be found, using existing config.');
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
else if (this.type === "accessory" /* PluginType.ACCESSORY */) {
|
|
395
|
+
const config = homebridgeConfig.accessories?.filter(x => x.accessory === this.identifier && x._bridge?.username === this.bridgeConfig.username);
|
|
396
|
+
if (config.length) {
|
|
397
|
+
this.pluginConfig = config;
|
|
398
|
+
this.bridgeConfig = this.pluginConfig[0]._bridge || this.bridgeConfig;
|
|
399
|
+
}
|
|
400
|
+
else {
|
|
401
|
+
this.log.warn('Accessory config could not be found, using existing config.');
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
catch (error) {
|
|
406
|
+
this.log.error('Failed to refresh plugin config:', error.message);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Returns metadata about this child bridge
|
|
411
|
+
*/
|
|
412
|
+
getMetadata() {
|
|
413
|
+
return {
|
|
414
|
+
status: this.bridgeStatus,
|
|
415
|
+
paired: this.pairedStatus,
|
|
416
|
+
setupUri: this.setupUri,
|
|
417
|
+
username: this.bridgeConfig.username,
|
|
418
|
+
pin: this.bridgeConfig.pin || this.homebridgeConfig.bridge.pin,
|
|
419
|
+
name: this.bridgeConfig.name || this.displayName || this.plugin.getPluginIdentifier(),
|
|
420
|
+
plugin: this.plugin.getPluginIdentifier(),
|
|
421
|
+
identifier: this.identifier,
|
|
422
|
+
pid: this.child?.pid,
|
|
423
|
+
manuallyStopped: this.manuallyStopped,
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
//# sourceMappingURL=childBridgeService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"childBridgeService.js","sourceRoot":"","sources":["../src/childBridgeService.ts"],"names":[],"mappings":"AAgBA,OAAO,aAAa,MAAM,oBAAoB,CAAA;AAC9C,OAAO,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,OAAO,MAAM,cAAc,CAAA;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,OAAO,EAAE,MAAM,UAAU,CAAA;AAIzB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AACjD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;AAErC,gDAAgD;AAChD,MAAM,CAAN,IAAkB,4BAwCjB;AAxCD,WAAkB,4BAA4B;IAC5C;;OAEG;IACH,+CAAe,CAAA;IAEf;;OAEG;IACH,6CAAa,CAAA;IAEb;;OAEG;IACH,iDAAiB,CAAA;IAEjB;;OAEG;IACH,+CAAe,CAAA;IAEf;;OAEG;IACH,iDAAiB,CAAA;IAEjB;;OAEG;IACH,4DAA4B,CAAA;IAE5B;;OAEG;IACH,gEAAgC,CAAA;IAEhC;;OAEG;IACH,wDAAwB,CAAA;AAC1B,CAAC,EAxCiB,4BAA4B,KAA5B,4BAA4B,QAwC7C;AAED,gDAAgD;AAChD,MAAM,CAAN,IAAkB,iBAejB;AAfD,WAAkB,iBAAiB;IACjC;;OAEG;IACH,wCAAmB,CAAA;IAEnB;;OAEG;IACH,8BAAS,CAAA;IAET;;OAEG;IACH,kCAAa,CAAA;AACf,CAAC,EAfiB,iBAAiB,KAAjB,iBAAiB,QAelC;AAgDD;;;GAGG;AACH,MAAM,O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