homebridge 2.0.0-alpha.41 → 2.0.0-alpha.43
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/dist/api.d.ts +81 -20
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +71 -11
- package/dist/api.js.map +1 -1
- package/dist/bridgeService.d.ts +14 -12
- package/dist/bridgeService.d.ts.map +1 -1
- package/dist/bridgeService.js +17 -3
- package/dist/bridgeService.js.map +1 -1
- package/dist/bridgeTypes.d.ts +54 -0
- package/dist/bridgeTypes.d.ts.map +1 -0
- package/dist/bridgeTypes.js +8 -0
- package/dist/bridgeTypes.js.map +1 -0
- package/dist/childBridgeFork.d.ts +23 -0
- package/dist/childBridgeFork.d.ts.map +1 -1
- package/dist/childBridgeFork.js +240 -4
- package/dist/childBridgeFork.js.map +1 -1
- package/dist/childBridgeService.d.ts +47 -7
- package/dist/childBridgeService.d.ts.map +1 -1
- package/dist/childBridgeService.js +67 -2
- package/dist/childBridgeService.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +3 -1
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +5 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/ipcService.d.ts +3 -1
- package/dist/ipcService.d.ts.map +1 -1
- package/dist/ipcService.js +2 -0
- package/dist/ipcService.js.map +1 -1
- package/dist/matter/index.d.ts +4 -6
- package/dist/matter/index.d.ts.map +1 -1
- package/dist/matter/index.js +4 -5
- package/dist/matter/index.js.map +1 -1
- package/dist/matter/matterConfigValidator.d.ts +2 -3
- package/dist/matter/matterConfigValidator.d.ts.map +1 -1
- package/dist/matter/matterConfigValidator.js +47 -38
- package/dist/matter/matterConfigValidator.js.map +1 -1
- package/dist/matter/matterErrorHandler.d.ts +6 -25
- package/dist/matter/matterErrorHandler.d.ts.map +1 -1
- package/dist/matter/matterErrorHandler.js +89 -99
- package/dist/matter/matterErrorHandler.js.map +1 -1
- package/dist/matter/matterServer.d.ts +126 -39
- package/dist/matter/matterServer.d.ts.map +1 -1
- package/dist/matter/matterServer.js +528 -226
- package/dist/matter/matterServer.js.map +1 -1
- package/dist/matter/matterSharedTypes.d.ts +16 -38
- package/dist/matter/matterSharedTypes.d.ts.map +1 -1
- package/dist/matter/matterSharedTypes.js +3 -4
- package/dist/matter/matterSharedTypes.js.map +1 -1
- package/dist/matter/matterStorage.d.ts +116 -0
- package/dist/matter/matterStorage.d.ts.map +1 -0
- package/dist/matter/matterStorage.js +442 -0
- package/dist/matter/matterStorage.js.map +1 -0
- package/dist/matter/matterTypes.d.ts +148 -20
- package/dist/matter/matterTypes.d.ts.map +1 -1
- package/dist/matter/matterTypes.js +91 -263
- package/dist/matter/matterTypes.js.map +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +4 -2
- package/dist/plugin.js.map +1 -1
- package/dist/server.d.ts +18 -4
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +376 -349
- package/dist/server.js.map +1 -1
- package/dist/user.d.ts +1 -0
- package/dist/user.d.ts.map +1 -1
- package/dist/user.js +3 -0
- package/dist/user.js.map +1 -1
- package/package.json +6 -7
- package/dist/childMatterBridgeFork.d.ts +0 -108
- package/dist/childMatterBridgeFork.d.ts.map +0 -1
- package/dist/childMatterBridgeFork.js +0 -330
- package/dist/childMatterBridgeFork.js.map +0 -1
- package/dist/childMatterBridgeService.d.ts +0 -166
- package/dist/childMatterBridgeService.d.ts.map +0 -1
- package/dist/childMatterBridgeService.js +0 -623
- package/dist/childMatterBridgeService.js.map +0 -1
- package/dist/matter/matterBridge.d.ts +0 -64
- package/dist/matter/matterBridge.d.ts.map +0 -1
- package/dist/matter/matterBridge.js +0 -154
- package/dist/matter/matterBridge.js.map +0 -1
- package/dist/matter/matterDevice.d.ts +0 -107
- package/dist/matter/matterDevice.d.ts.map +0 -1
- package/dist/matter/matterDevice.js +0 -913
- package/dist/matter/matterDevice.js.map +0 -1
- package/dist/matter/portAllocator.d.ts +0 -85
- package/dist/matter/portAllocator.d.ts.map +0 -1
- package/dist/matter/portAllocator.js +0 -296
- package/dist/matter/portAllocator.js.map +0 -1
|
@@ -1,623 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Child Matter Bridge Service
|
|
3
|
-
*
|
|
4
|
-
* Manages Matter bridges for individual plugins/accessories running as child bridges.
|
|
5
|
-
* Provides parallel functionality to ChildBridgeService but for Matter protocol.
|
|
6
|
-
*/
|
|
7
|
-
import { fork } from 'node:child_process';
|
|
8
|
-
import * as fs from 'node:fs/promises';
|
|
9
|
-
import net from 'node:net';
|
|
10
|
-
import * as os from 'node:os';
|
|
11
|
-
import * as path from 'node:path';
|
|
12
|
-
import { dirname, resolve } from 'node:path';
|
|
13
|
-
import process from 'node:process';
|
|
14
|
-
import { fileURLToPath } from 'node:url';
|
|
15
|
-
import { Logger } from './logger.js';
|
|
16
|
-
import { ChildMatterMessageType, MatterBridgeStatus } from './matter/matterSharedTypes.js';
|
|
17
|
-
import { portAllocator } from './matter/portAllocator.js';
|
|
18
|
-
import { PlatformAccessory } from './platformAccessory.js';
|
|
19
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
20
|
-
const __dirname = dirname(__filename);
|
|
21
|
-
export { MatterBridgeStatus as ChildMatterBridgeStatus } from './matter/matterSharedTypes.js';
|
|
22
|
-
/**
|
|
23
|
-
* Manages Matter bridges for child plugins/accessories.
|
|
24
|
-
* Each instance represents a separate Matter bridge for a specific plugin configuration.
|
|
25
|
-
*/
|
|
26
|
-
export class ChildMatterBridgeService {
|
|
27
|
-
type;
|
|
28
|
-
plugin;
|
|
29
|
-
matterConfig;
|
|
30
|
-
pluginConfig;
|
|
31
|
-
api;
|
|
32
|
-
externalPortService;
|
|
33
|
-
homebridgeOptions;
|
|
34
|
-
ipcService;
|
|
35
|
-
homebridgeConfig;
|
|
36
|
-
child;
|
|
37
|
-
status = MatterBridgeStatus.PENDING;
|
|
38
|
-
accessories = new Map();
|
|
39
|
-
log;
|
|
40
|
-
displayName;
|
|
41
|
-
identifier;
|
|
42
|
-
shuttingDown = false;
|
|
43
|
-
childProcessReady = false;
|
|
44
|
-
childBridgeStatus = {};
|
|
45
|
-
constructor(type, plugin, matterConfig, pluginConfig, api, externalPortService, homebridgeOptions, ipcService, homebridgeConfig) {
|
|
46
|
-
this.type = type;
|
|
47
|
-
this.plugin = plugin;
|
|
48
|
-
this.matterConfig = matterConfig;
|
|
49
|
-
this.pluginConfig = pluginConfig;
|
|
50
|
-
this.api = api;
|
|
51
|
-
this.externalPortService = externalPortService;
|
|
52
|
-
this.homebridgeOptions = homebridgeOptions;
|
|
53
|
-
this.ipcService = ipcService;
|
|
54
|
-
this.homebridgeConfig = homebridgeConfig;
|
|
55
|
-
// Set identifier based on config type
|
|
56
|
-
if (this.type === "platform" /* PluginType.PLATFORM */ && 'platform' in this.pluginConfig) {
|
|
57
|
-
this.identifier = `${plugin.getPluginIdentifier()}-${this.pluginConfig.platform}`;
|
|
58
|
-
}
|
|
59
|
-
else if (this.type === "accessory" /* PluginType.ACCESSORY */ && 'accessory' in this.pluginConfig) {
|
|
60
|
-
this.identifier = `${plugin.getPluginIdentifier()}-${this.pluginConfig.accessory}`;
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
this.identifier = `${plugin.getPluginIdentifier()}-external`;
|
|
64
|
-
}
|
|
65
|
-
this.displayName = this.matterConfig.name || `${this.pluginConfig.name || plugin.getPluginIdentifier()} Matter Bridge`;
|
|
66
|
-
this.log = Logger.withPrefix(this.displayName);
|
|
67
|
-
// Enable debug logging for this Matter bridge if debug flag is set
|
|
68
|
-
if (this.matterConfig.debug) {
|
|
69
|
-
// Note: This enables debug for the parent process logging of this bridge
|
|
70
|
-
// The child process will have its own debug flag set via command-line args
|
|
71
|
-
// We may want to isolate this better in the future
|
|
72
|
-
}
|
|
73
|
-
// Listen for shutdown
|
|
74
|
-
this.api.on('shutdown', () => {
|
|
75
|
-
this.shuttingDown = true;
|
|
76
|
-
void this.teardown();
|
|
77
|
-
});
|
|
78
|
-
// Increase max listeners
|
|
79
|
-
this.api.setMaxListeners(this.api.getMaxListeners() + 1);
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Start the child Matter bridge
|
|
83
|
-
*/
|
|
84
|
-
async start() {
|
|
85
|
-
if (this.status === MatterBridgeStatus.OK) {
|
|
86
|
-
this.log.warn('Child Matter bridge already started');
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
this.status = MatterBridgeStatus.PENDING;
|
|
90
|
-
this.sendStatusUpdate();
|
|
91
|
-
// Always start in child process
|
|
92
|
-
await this.startChildProcess();
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Start Matter bridge in child process
|
|
96
|
-
*/
|
|
97
|
-
async startChildProcess() {
|
|
98
|
-
this.log.info('Starting child Matter bridge in separate process...');
|
|
99
|
-
// Prepare arguments for child process
|
|
100
|
-
const args = [];
|
|
101
|
-
// Pass debug flag if enabled for this Matter bridge
|
|
102
|
-
if (this.matterConfig.debug) {
|
|
103
|
-
args.push('-D');
|
|
104
|
-
}
|
|
105
|
-
// Fork the child process
|
|
106
|
-
this.child = fork(resolve(__dirname, 'childMatterBridgeFork.js'), args, {
|
|
107
|
-
silent: false, // Let child handle its own stdio
|
|
108
|
-
env: {
|
|
109
|
-
...process.env,
|
|
110
|
-
HOMEBRIDGE_CHILD_MATTER_BRIDGE: '1',
|
|
111
|
-
},
|
|
112
|
-
});
|
|
113
|
-
// Handle child process events
|
|
114
|
-
this.child.on('error', (error) => {
|
|
115
|
-
this.log.error('Child process error:', error);
|
|
116
|
-
this.status = MatterBridgeStatus.DOWN;
|
|
117
|
-
this.sendStatusUpdate();
|
|
118
|
-
});
|
|
119
|
-
this.child.on('exit', (code, signal) => {
|
|
120
|
-
this.log.warn(`Child process exited (code: ${code}, signal: ${signal})`);
|
|
121
|
-
this.status = MatterBridgeStatus.DOWN;
|
|
122
|
-
this.sendStatusUpdate();
|
|
123
|
-
// Restart if not shutting down
|
|
124
|
-
if (!this.shuttingDown && code !== 0) {
|
|
125
|
-
this.log.info('Attempting to restart child process...');
|
|
126
|
-
setTimeout(() => {
|
|
127
|
-
this.startChildProcess().catch((error) => {
|
|
128
|
-
this.log.error('Failed to restart child process:', error);
|
|
129
|
-
});
|
|
130
|
-
}, 5000);
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
// Handle IPC messages from child
|
|
134
|
-
this.child.on('message', (message) => {
|
|
135
|
-
this.handleChildMessage(message);
|
|
136
|
-
});
|
|
137
|
-
// Wait for child to be ready
|
|
138
|
-
await this.waitForChildReady();
|
|
139
|
-
// Send configuration to child
|
|
140
|
-
await this.loadChildPlugin();
|
|
141
|
-
// Start the Matter bridge in child
|
|
142
|
-
await this.startChildMatterBridge();
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Wait for child process to be ready
|
|
146
|
-
*/
|
|
147
|
-
async waitForChildReady() {
|
|
148
|
-
return new Promise((resolve, reject) => {
|
|
149
|
-
const timeout = setTimeout(() => {
|
|
150
|
-
reject(new Error('Child process did not respond in time'));
|
|
151
|
-
}, 10000);
|
|
152
|
-
const messageHandler = (message) => {
|
|
153
|
-
if (message?.id === ChildMatterMessageType.READY) {
|
|
154
|
-
clearTimeout(timeout);
|
|
155
|
-
this.child?.off('message', messageHandler);
|
|
156
|
-
this.childProcessReady = true;
|
|
157
|
-
resolve();
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
this.child?.on('message', messageHandler);
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* Send plugin configuration to child
|
|
165
|
-
*/
|
|
166
|
-
async loadChildPlugin() {
|
|
167
|
-
return new Promise((resolve, reject) => {
|
|
168
|
-
const timeout = setTimeout(() => {
|
|
169
|
-
reject(new Error('Child process did not load plugin in time'));
|
|
170
|
-
}, 10000);
|
|
171
|
-
const messageHandler = (message) => {
|
|
172
|
-
if (message?.id === ChildMatterMessageType.LOADED) {
|
|
173
|
-
clearTimeout(timeout);
|
|
174
|
-
this.child?.off('message', messageHandler);
|
|
175
|
-
this.log.debug(`Child loaded plugin version ${message.data?.version}`);
|
|
176
|
-
resolve();
|
|
177
|
-
}
|
|
178
|
-
};
|
|
179
|
-
this.child?.on('message', messageHandler);
|
|
180
|
-
// Send load message with proper name
|
|
181
|
-
const loadData = {
|
|
182
|
-
type: this.type,
|
|
183
|
-
identifier: this.identifier,
|
|
184
|
-
pluginPath: this.plugin.getPluginPath(),
|
|
185
|
-
pluginConfig: this.pluginConfig,
|
|
186
|
-
matterConfig: {
|
|
187
|
-
...this.matterConfig,
|
|
188
|
-
// Ensure we have a proper name for the Matter bridge
|
|
189
|
-
name: this.matterConfig.name || this.displayName,
|
|
190
|
-
},
|
|
191
|
-
homebridgeConfig: this.homebridgeConfig || {},
|
|
192
|
-
bridgeOptions: this.homebridgeOptions,
|
|
193
|
-
};
|
|
194
|
-
this.sendToChild(ChildMatterMessageType.LOAD, loadData);
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* Start Matter bridge in child process
|
|
199
|
-
*/
|
|
200
|
-
async startChildMatterBridge() {
|
|
201
|
-
return new Promise((resolve, reject) => {
|
|
202
|
-
let resolved = false;
|
|
203
|
-
let timeout = null;
|
|
204
|
-
// Cleanup function to ensure all listeners are removed
|
|
205
|
-
const cleanup = () => {
|
|
206
|
-
if (timeout) {
|
|
207
|
-
clearTimeout(timeout);
|
|
208
|
-
timeout = null;
|
|
209
|
-
}
|
|
210
|
-
if (this.child) {
|
|
211
|
-
// eslint-disable-next-line ts/no-use-before-define
|
|
212
|
-
this.child.off('message', messageHandler);
|
|
213
|
-
}
|
|
214
|
-
};
|
|
215
|
-
// Define message handler
|
|
216
|
-
const messageHandler = (message) => {
|
|
217
|
-
if (resolved) {
|
|
218
|
-
return;
|
|
219
|
-
} // Prevent multiple resolutions
|
|
220
|
-
this.log.debug('Received message from child:', message?.id);
|
|
221
|
-
if (message?.id === ChildMatterMessageType.ONLINE) {
|
|
222
|
-
resolved = true;
|
|
223
|
-
cleanup();
|
|
224
|
-
const data = message.data;
|
|
225
|
-
this.status = MatterBridgeStatus.OK;
|
|
226
|
-
this.sendStatusUpdate();
|
|
227
|
-
// Store the child bridge status
|
|
228
|
-
this.childBridgeStatus = {
|
|
229
|
-
port: data.port,
|
|
230
|
-
serialNumber: data.serialNumber,
|
|
231
|
-
commissioned: data.commissioned,
|
|
232
|
-
};
|
|
233
|
-
this.log.success(`Child Matter bridge started on port ${data.port}`);
|
|
234
|
-
resolve();
|
|
235
|
-
}
|
|
236
|
-
else if (message?.id === ChildMatterMessageType.ERROR) {
|
|
237
|
-
resolved = true;
|
|
238
|
-
cleanup();
|
|
239
|
-
const errorData = message.data;
|
|
240
|
-
this.log.error(`Child Matter bridge failed to start: ${errorData.message}`);
|
|
241
|
-
if (errorData.stack) {
|
|
242
|
-
this.log.debug('Stack trace:', errorData.stack);
|
|
243
|
-
}
|
|
244
|
-
reject(new Error(`Child Matter bridge failed: ${errorData.message}`));
|
|
245
|
-
}
|
|
246
|
-
};
|
|
247
|
-
// Set timeout
|
|
248
|
-
const timeoutFn = () => {
|
|
249
|
-
if (!resolved) {
|
|
250
|
-
resolved = true;
|
|
251
|
-
cleanup();
|
|
252
|
-
this.log.error('Child Matter bridge startup timeout - check logs for details');
|
|
253
|
-
reject(new Error('Child Matter bridge did not start in time (60s timeout)'));
|
|
254
|
-
}
|
|
255
|
-
};
|
|
256
|
-
timeout = setTimeout(timeoutFn, 60000); // 60 seconds
|
|
257
|
-
this.child?.on('message', messageHandler);
|
|
258
|
-
// Send start message
|
|
259
|
-
this.sendToChild(ChildMatterMessageType.START);
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* Handle messages from child process
|
|
264
|
-
*/
|
|
265
|
-
handleChildMessage(message) {
|
|
266
|
-
if (!message?.id) {
|
|
267
|
-
return;
|
|
268
|
-
}
|
|
269
|
-
switch (message.id) {
|
|
270
|
-
case ChildMatterMessageType.STATUS_UPDATE: {
|
|
271
|
-
const data = message.data;
|
|
272
|
-
this.status = data.status === 'ok'
|
|
273
|
-
? MatterBridgeStatus.OK
|
|
274
|
-
: data.status === 'pending'
|
|
275
|
-
? MatterBridgeStatus.PENDING
|
|
276
|
-
: MatterBridgeStatus.DOWN;
|
|
277
|
-
// Update child bridge status with commissioning info
|
|
278
|
-
if (data.port) {
|
|
279
|
-
this.childBridgeStatus.port = data.port;
|
|
280
|
-
}
|
|
281
|
-
if (data.qrCode) {
|
|
282
|
-
this.childBridgeStatus.qrCode = data.qrCode;
|
|
283
|
-
}
|
|
284
|
-
if (data.manualPairingCode) {
|
|
285
|
-
this.childBridgeStatus.manualPairingCode = data.manualPairingCode;
|
|
286
|
-
}
|
|
287
|
-
if (data.serialNumber) {
|
|
288
|
-
this.childBridgeStatus.serialNumber = data.serialNumber;
|
|
289
|
-
}
|
|
290
|
-
if (data.commissioned !== undefined) {
|
|
291
|
-
this.childBridgeStatus.commissioned = data.commissioned;
|
|
292
|
-
}
|
|
293
|
-
this.sendStatusUpdate();
|
|
294
|
-
this.log.debug(`Child status update: ${data.status}, devices: ${data.deviceCount}`);
|
|
295
|
-
break;
|
|
296
|
-
}
|
|
297
|
-
case ChildMatterMessageType.PORT_REQUEST: {
|
|
298
|
-
void this.handlePortRequest(message.data);
|
|
299
|
-
break;
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
/**
|
|
304
|
-
* Handle port request from child
|
|
305
|
-
*/
|
|
306
|
-
async handlePortRequest(data) {
|
|
307
|
-
try {
|
|
308
|
-
const port = await this.externalPortService.requestPort(data.identifier);
|
|
309
|
-
this.sendToChild(ChildMatterMessageType.PORT_ALLOCATED, { port });
|
|
310
|
-
}
|
|
311
|
-
catch (error) {
|
|
312
|
-
this.log.error('Failed to allocate port for child:', error);
|
|
313
|
-
this.sendToChild(ChildMatterMessageType.PORT_ALLOCATED, { port: undefined });
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
/**
|
|
317
|
-
* Send message to child process
|
|
318
|
-
*/
|
|
319
|
-
sendToChild(type, data) {
|
|
320
|
-
if (this.child && !this.child.killed) {
|
|
321
|
-
this.child.send({ id: type, data });
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
/**
|
|
325
|
-
* Add an accessory to the child Matter bridge
|
|
326
|
-
*/
|
|
327
|
-
async addAccessory(accessory) {
|
|
328
|
-
if (this.accessories.has(accessory.UUID)) {
|
|
329
|
-
this.log.debug(`Accessory ${accessory.displayName} already added to Matter bridge`);
|
|
330
|
-
return;
|
|
331
|
-
}
|
|
332
|
-
// Send accessory to child process
|
|
333
|
-
if (!this.child || this.child.killed || !this.childProcessReady) {
|
|
334
|
-
this.log.error('Cannot add accessory - child process not ready');
|
|
335
|
-
return;
|
|
336
|
-
}
|
|
337
|
-
try {
|
|
338
|
-
// Serialize the accessory for IPC
|
|
339
|
-
const serialized = PlatformAccessory.serialize(accessory);
|
|
340
|
-
this.sendToChild(ChildMatterMessageType.ADD_ACCESSORY, { accessory: serialized });
|
|
341
|
-
// Track locally
|
|
342
|
-
this.accessories.set(accessory.UUID, accessory);
|
|
343
|
-
this.log.info(`Sent ${accessory.displayName} to child Matter bridge`);
|
|
344
|
-
}
|
|
345
|
-
catch (error) {
|
|
346
|
-
this.log.error(`Error sending accessory ${accessory.displayName} to child:`, error);
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
/**
|
|
350
|
-
* Remove an accessory from the child Matter bridge
|
|
351
|
-
*/
|
|
352
|
-
async removeAccessory(accessory) {
|
|
353
|
-
if (!this.accessories.has(accessory.UUID)) {
|
|
354
|
-
return;
|
|
355
|
-
}
|
|
356
|
-
// Send removal to child process
|
|
357
|
-
if (!this.child || this.child.killed || !this.childProcessReady) {
|
|
358
|
-
this.log.error('Cannot remove accessory - child process not ready');
|
|
359
|
-
return;
|
|
360
|
-
}
|
|
361
|
-
try {
|
|
362
|
-
// Serialize the accessory for IPC
|
|
363
|
-
const serialized = PlatformAccessory.serialize(accessory);
|
|
364
|
-
this.sendToChild(ChildMatterMessageType.REMOVE_ACCESSORY, { accessory: serialized });
|
|
365
|
-
// Remove from local tracking
|
|
366
|
-
this.accessories.delete(accessory.UUID);
|
|
367
|
-
this.log.info(`Sent removal of ${accessory.displayName} to child Matter bridge`);
|
|
368
|
-
}
|
|
369
|
-
catch (error) {
|
|
370
|
-
this.log.error(`Error sending accessory removal ${accessory.displayName} to child:`, error);
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
/**
|
|
374
|
-
* Get metadata about this child Matter bridge
|
|
375
|
-
*/
|
|
376
|
-
getMetadata() {
|
|
377
|
-
return {
|
|
378
|
-
type: 'matter', // Explicitly identify as Matter bridge
|
|
379
|
-
status: this.status,
|
|
380
|
-
port: this.childBridgeStatus.port || this.matterConfig.port,
|
|
381
|
-
qrCode: this.childBridgeStatus.qrCode,
|
|
382
|
-
manualPairingCode: this.childBridgeStatus.manualPairingCode,
|
|
383
|
-
serialNumber: this.childBridgeStatus.serialNumber,
|
|
384
|
-
name: this.displayName,
|
|
385
|
-
plugin: this.plugin.getPluginIdentifier(),
|
|
386
|
-
identifier: this.identifier,
|
|
387
|
-
deviceCount: this.accessories.size,
|
|
388
|
-
manuallyStopped: this.shuttingDown,
|
|
389
|
-
pid: this.child?.pid,
|
|
390
|
-
commissioned: this.childBridgeStatus.commissioned || false,
|
|
391
|
-
};
|
|
392
|
-
}
|
|
393
|
-
/**
|
|
394
|
-
* Get Matter accessories for this child bridge
|
|
395
|
-
*/
|
|
396
|
-
getMatterAccessories() {
|
|
397
|
-
const accessories = [];
|
|
398
|
-
for (const [uuid, accessory] of this.accessories) {
|
|
399
|
-
// Convert accessory to Matter format for UI
|
|
400
|
-
accessories.push({
|
|
401
|
-
uuid,
|
|
402
|
-
displayName: accessory.displayName,
|
|
403
|
-
category: accessory.category,
|
|
404
|
-
services: accessory.services.map(service => ({
|
|
405
|
-
type: service.UUID,
|
|
406
|
-
subtype: service.subtype,
|
|
407
|
-
displayName: service.displayName,
|
|
408
|
-
characteristics: service.characteristics.map(char => ({
|
|
409
|
-
type: char.UUID,
|
|
410
|
-
value: char.value,
|
|
411
|
-
props: char.props,
|
|
412
|
-
})),
|
|
413
|
-
})),
|
|
414
|
-
matterInfo: {
|
|
415
|
-
bridged: true,
|
|
416
|
-
childBridge: this.identifier,
|
|
417
|
-
},
|
|
418
|
-
});
|
|
419
|
-
}
|
|
420
|
-
return accessories;
|
|
421
|
-
}
|
|
422
|
-
/**
|
|
423
|
-
* Stop the child Matter bridge
|
|
424
|
-
*/
|
|
425
|
-
async teardown(permanent = false) {
|
|
426
|
-
if (this.status === MatterBridgeStatus.DOWN) {
|
|
427
|
-
return;
|
|
428
|
-
}
|
|
429
|
-
this.log.info('Stopping child Matter bridge...');
|
|
430
|
-
this.status = MatterBridgeStatus.DOWN;
|
|
431
|
-
this.sendStatusUpdate();
|
|
432
|
-
// Release allocated ports
|
|
433
|
-
try {
|
|
434
|
-
await portAllocator.releasePorts(this.identifier);
|
|
435
|
-
}
|
|
436
|
-
catch (error) {
|
|
437
|
-
this.log.debug('Error releasing ports:', error);
|
|
438
|
-
}
|
|
439
|
-
// Match HAP child bridge behavior - just send SIGTERM
|
|
440
|
-
if (this.child && this.child.connected) {
|
|
441
|
-
this.child.kill('SIGTERM');
|
|
442
|
-
}
|
|
443
|
-
this.child = undefined;
|
|
444
|
-
this.childProcessReady = false;
|
|
445
|
-
this.accessories.clear();
|
|
446
|
-
// If this is a permanent removal, clean up Matter storage
|
|
447
|
-
if (permanent) {
|
|
448
|
-
await this.cleanupMatterStorage();
|
|
449
|
-
}
|
|
450
|
-
this.log.info('Child Matter bridge stopped');
|
|
451
|
-
}
|
|
452
|
-
/**
|
|
453
|
-
* Clean up Matter storage when bridge is permanently removed
|
|
454
|
-
*/
|
|
455
|
-
async cleanupMatterStorage() {
|
|
456
|
-
try {
|
|
457
|
-
// Get the storage path for this Matter bridge
|
|
458
|
-
// Use customStoragePath if set, otherwise use default Homebridge storage path
|
|
459
|
-
const storagePath = this.homebridgeOptions.customStoragePath || path.join(os.homedir(), '.homebridge');
|
|
460
|
-
if (!storagePath) {
|
|
461
|
-
this.log.debug('No storage path found for Matter cleanup');
|
|
462
|
-
return;
|
|
463
|
-
}
|
|
464
|
-
// Construct the Matter storage directory path
|
|
465
|
-
// Matter storage is typically in {storagePath}/.matter/{identifier}
|
|
466
|
-
// Use the bridge's unique ID for storage path consistency
|
|
467
|
-
const bridgeId = this.identifier.replace(/[^a-z0-9-]/gi, '_');
|
|
468
|
-
const matterStoragePath = path.join(storagePath, '.matter', bridgeId);
|
|
469
|
-
// Check if the directory exists
|
|
470
|
-
try {
|
|
471
|
-
await fs.access(matterStoragePath);
|
|
472
|
-
}
|
|
473
|
-
catch {
|
|
474
|
-
// Directory doesn't exist, nothing to clean up
|
|
475
|
-
this.log.debug(`Matter storage directory not found: ${matterStoragePath}`);
|
|
476
|
-
return;
|
|
477
|
-
}
|
|
478
|
-
// Remove the Matter storage directory
|
|
479
|
-
this.log.info(`Cleaning up Matter storage for bridge: ${this.identifier}`);
|
|
480
|
-
await fs.rm(matterStoragePath, { recursive: true, force: true });
|
|
481
|
-
this.log.info(`Successfully removed Matter storage: ${matterStoragePath}`);
|
|
482
|
-
// Also check for legacy storage locations that might exist
|
|
483
|
-
const legacyPaths = [
|
|
484
|
-
path.join(storagePath, `.matter-${this.identifier}`),
|
|
485
|
-
path.join(storagePath, 'matter', this.identifier),
|
|
486
|
-
];
|
|
487
|
-
for (const legacyPath of legacyPaths) {
|
|
488
|
-
try {
|
|
489
|
-
await fs.access(legacyPath);
|
|
490
|
-
await fs.rm(legacyPath, { recursive: true, force: true });
|
|
491
|
-
this.log.info(`Cleaned up legacy Matter storage: ${legacyPath}`);
|
|
492
|
-
}
|
|
493
|
-
catch {
|
|
494
|
-
// Legacy path doesn't exist, skip
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
catch (error) {
|
|
499
|
-
this.log.error('Failed to clean up Matter storage:', error);
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
/**
|
|
503
|
-
* Restart the child Matter bridge
|
|
504
|
-
*/
|
|
505
|
-
async restart() {
|
|
506
|
-
this.log.info('Restarting Matter bridge...');
|
|
507
|
-
// Send pending status immediately
|
|
508
|
-
this.status = MatterBridgeStatus.PENDING;
|
|
509
|
-
this.sendStatusUpdate();
|
|
510
|
-
await this.teardown();
|
|
511
|
-
// Wait a moment before restarting
|
|
512
|
-
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
513
|
-
await this.start();
|
|
514
|
-
this.log.success('Matter bridge restarted');
|
|
515
|
-
}
|
|
516
|
-
/**
|
|
517
|
-
* Restart child bridge (IPC interface)
|
|
518
|
-
*/
|
|
519
|
-
async restartChildBridge() {
|
|
520
|
-
return this.restart();
|
|
521
|
-
}
|
|
522
|
-
/**
|
|
523
|
-
* Stop child bridge (IPC interface)
|
|
524
|
-
*/
|
|
525
|
-
async stopChildBridge() {
|
|
526
|
-
return this.teardown();
|
|
527
|
-
}
|
|
528
|
-
/**
|
|
529
|
-
* Start child bridge (IPC interface)
|
|
530
|
-
*/
|
|
531
|
-
async startChildBridge() {
|
|
532
|
-
return this.start();
|
|
533
|
-
}
|
|
534
|
-
/**
|
|
535
|
-
* Allocate a port for the Matter bridge
|
|
536
|
-
*/
|
|
537
|
-
async allocatePort() {
|
|
538
|
-
// First try to get a port from the external port service
|
|
539
|
-
try {
|
|
540
|
-
const allocated = await this.externalPortService.requestPort(`matter-${this.identifier}`);
|
|
541
|
-
if (allocated) {
|
|
542
|
-
this.log.debug(`Allocated port ${allocated} from external port service`);
|
|
543
|
-
return allocated;
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
catch (error) {
|
|
547
|
-
this.log.debug('External port service allocation failed, trying automatic allocation');
|
|
548
|
-
}
|
|
549
|
-
// Fall back to automatic port allocation in Matter range
|
|
550
|
-
const basePort = 5540;
|
|
551
|
-
const maxPort = 5580;
|
|
552
|
-
// Try to find an available port
|
|
553
|
-
for (let port = basePort; port <= maxPort; port++) {
|
|
554
|
-
if (await this.isPortAvailable(port)) {
|
|
555
|
-
this.log.debug(`Found available port ${port}`);
|
|
556
|
-
return port;
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
// If no ports available in default range, try random high ports
|
|
560
|
-
for (let i = 0; i < 10; i++) {
|
|
561
|
-
const port = 30000 + Math.floor(Math.random() * 20000);
|
|
562
|
-
if (await this.isPortAvailable(port)) {
|
|
563
|
-
this.log.debug(`Found available random port ${port}`);
|
|
564
|
-
return port;
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
throw new Error(`Could not allocate port for Matter bridge ${this.displayName}`);
|
|
568
|
-
}
|
|
569
|
-
/**
|
|
570
|
-
* Check if a port is available
|
|
571
|
-
*/
|
|
572
|
-
async isPortAvailable(port) {
|
|
573
|
-
return new Promise((resolve) => {
|
|
574
|
-
const server = net.createServer();
|
|
575
|
-
server.once('error', () => {
|
|
576
|
-
resolve(false);
|
|
577
|
-
});
|
|
578
|
-
server.once('listening', () => {
|
|
579
|
-
server.close();
|
|
580
|
-
resolve(true);
|
|
581
|
-
});
|
|
582
|
-
server.listen(port, '0.0.0.0');
|
|
583
|
-
});
|
|
584
|
-
}
|
|
585
|
-
/**
|
|
586
|
-
* Send status update via IPC
|
|
587
|
-
*/
|
|
588
|
-
sendStatusUpdate() {
|
|
589
|
-
if (this.ipcService) {
|
|
590
|
-
this.ipcService.sendMessage("matterBridgeStatusUpdate" /* IpcOutgoingEvent.MATTER_BRIDGE_STATUS_UPDATE */, this.getMetadata());
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
/**
|
|
594
|
-
* Check if the bridge is running
|
|
595
|
-
*/
|
|
596
|
-
isRunning() {
|
|
597
|
-
return this.status === MatterBridgeStatus.OK;
|
|
598
|
-
}
|
|
599
|
-
/**
|
|
600
|
-
* Get the plugin identifier
|
|
601
|
-
*/
|
|
602
|
-
getPluginIdentifier() {
|
|
603
|
-
return this.plugin.getPluginIdentifier();
|
|
604
|
-
}
|
|
605
|
-
/**
|
|
606
|
-
* Get the display name
|
|
607
|
-
*/
|
|
608
|
-
getDisplayName() {
|
|
609
|
-
return this.displayName;
|
|
610
|
-
}
|
|
611
|
-
/**
|
|
612
|
-
* Get commissioning info for the Matter bridge
|
|
613
|
-
*/
|
|
614
|
-
getCommissioningInfo() {
|
|
615
|
-
const metadata = this.getMetadata();
|
|
616
|
-
return {
|
|
617
|
-
qrCode: metadata.qrCode,
|
|
618
|
-
manualPairingCode: metadata.manualPairingCode,
|
|
619
|
-
commissioned: this.childBridgeStatus.commissioned || false,
|
|
620
|
-
};
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
//# sourceMappingURL=childMatterBridgeService.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"childMatterBridgeService.js","sourceRoot":"","sources":["../src/childMatterBridgeService.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAaH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AACzC,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,GAAG,MAAM,UAAU,CAAA;AAC1B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAC7B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,OAAO,MAAM,cAAc,CAAA;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAKxC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAC1F,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,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