homebridge 2.0.0-alpha.40 → 2.0.0-alpha.41
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/config-sample.json +1 -12
- package/dist/api.d.ts +4 -20
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +1 -27
- package/dist/api.js.map +1 -1
- package/dist/bridgeService.d.ts +12 -15
- package/dist/bridgeService.d.ts.map +1 -1
- package/dist/bridgeService.js +7 -7
- package/dist/bridgeService.js.map +1 -1
- package/dist/childBridgeService.d.ts +1 -0
- package/dist/childBridgeService.d.ts.map +1 -1
- package/dist/childBridgeService.js +1 -0
- package/dist/childBridgeService.js.map +1 -1
- package/dist/childMatterBridgeFork.d.ts +108 -0
- package/dist/childMatterBridgeFork.d.ts.map +1 -0
- package/dist/childMatterBridgeFork.js +330 -0
- package/dist/childMatterBridgeFork.js.map +1 -0
- package/dist/childMatterBridgeService.d.ts +166 -0
- package/dist/childMatterBridgeService.d.ts.map +1 -0
- package/dist/childMatterBridgeService.js +623 -0
- package/dist/childMatterBridgeService.js.map +1 -0
- package/dist/index.d.ts +8 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/ipcService.d.ts +19 -3
- package/dist/ipcService.d.ts.map +1 -1
- package/dist/ipcService.js +13 -0
- package/dist/ipcService.js.map +1 -1
- package/dist/matter/index.d.ts +13 -0
- package/dist/matter/index.d.ts.map +1 -0
- package/dist/matter/index.js +12 -0
- package/dist/matter/index.js.map +1 -0
- package/dist/matter/matterBridge.d.ts +64 -0
- package/dist/matter/matterBridge.d.ts.map +1 -0
- package/dist/matter/matterBridge.js +154 -0
- package/dist/matter/matterBridge.js.map +1 -0
- package/dist/matter/matterConfigValidator.d.ts +27 -0
- package/dist/matter/matterConfigValidator.d.ts.map +1 -0
- package/dist/matter/matterConfigValidator.js +162 -0
- package/dist/matter/matterConfigValidator.js.map +1 -0
- package/dist/matter/matterDevice.d.ts +107 -0
- package/dist/matter/matterDevice.d.ts.map +1 -0
- package/dist/matter/matterDevice.js +913 -0
- package/dist/matter/matterDevice.js.map +1 -0
- package/dist/matter/matterDiagnostics.d.ts +121 -0
- package/dist/matter/matterDiagnostics.d.ts.map +1 -0
- package/dist/matter/matterDiagnostics.js +323 -0
- package/dist/matter/matterDiagnostics.js.map +1 -0
- package/dist/matter/matterErrorHandler.d.ts +113 -0
- package/dist/matter/matterErrorHandler.d.ts.map +1 -0
- package/dist/matter/matterErrorHandler.js +482 -0
- package/dist/matter/matterErrorHandler.js.map +1 -0
- package/dist/matter/matterNetworkMonitor.d.ts +65 -0
- package/dist/matter/matterNetworkMonitor.d.ts.map +1 -0
- package/dist/matter/matterNetworkMonitor.js +227 -0
- package/dist/matter/matterNetworkMonitor.js.map +1 -0
- package/dist/matter/matterServer.d.ts +110 -0
- package/dist/matter/matterServer.d.ts.map +1 -0
- package/dist/matter/matterServer.js +584 -0
- package/dist/matter/matterServer.js.map +1 -0
- package/dist/matter/matterSharedTypes.d.ts +167 -0
- package/dist/matter/matterSharedTypes.d.ts.map +1 -0
- package/dist/matter/matterSharedTypes.js +55 -0
- package/dist/matter/matterSharedTypes.js.map +1 -0
- package/dist/{matterTypes.d.ts → matter/matterTypes.d.ts} +15 -0
- package/dist/matter/matterTypes.d.ts.map +1 -0
- package/dist/{matterTypes.js → matter/matterTypes.js} +4 -4
- package/dist/matter/matterTypes.js.map +1 -0
- package/dist/matter/portAllocator.d.ts +85 -0
- package/dist/matter/portAllocator.d.ts.map +1 -0
- package/dist/matter/portAllocator.js +296 -0
- package/dist/matter/portAllocator.js.map +1 -0
- package/dist/server.d.ts +9 -3
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +363 -31
- package/dist/server.js.map +1 -1
- package/package.json +10 -10
- package/dist/matterConfigValidator.d.ts +0 -34
- package/dist/matterConfigValidator.d.ts.map +0 -1
- package/dist/matterConfigValidator.js +0 -249
- package/dist/matterConfigValidator.js.map +0 -1
- package/dist/matterService.d.ts +0 -168
- package/dist/matterService.d.ts.map +0 -1
- package/dist/matterService.js +0 -677
- package/dist/matterService.js.map +0 -1
- package/dist/matterTypes.d.ts.map +0 -1
- package/dist/matterTypes.js.map +0 -1
- package/dist/util/matter-cli.d.ts +0 -3
- package/dist/util/matter-cli.d.ts.map +0 -1
- package/dist/util/matter-cli.js +0 -211
- package/dist/util/matter-cli.js.map +0 -1
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Child Matter Bridge Fork
|
|
3
|
+
*
|
|
4
|
+
* This is a standalone script executed as a child process fork
|
|
5
|
+
* specifically for running Matter bridges in isolation
|
|
6
|
+
*/
|
|
7
|
+
import process from 'node:process';
|
|
8
|
+
import { HAPStorage } from 'hap-nodejs';
|
|
9
|
+
import { HomebridgeAPI } from './api.js';
|
|
10
|
+
import { Logger } from './logger.js';
|
|
11
|
+
import { MatterServer } from './matter/index.js';
|
|
12
|
+
import { ChildMatterMessageType } from './matter/matterSharedTypes.js';
|
|
13
|
+
import { PlatformAccessory } from './platformAccessory.js';
|
|
14
|
+
import { PluginManager } from './pluginManager.js';
|
|
15
|
+
import { User } from './user.js';
|
|
16
|
+
import 'source-map-support/register.js';
|
|
17
|
+
// Re-export for backward compatibility
|
|
18
|
+
export { ChildMatterMessageType } from './matter/matterSharedTypes.js';
|
|
19
|
+
/**
|
|
20
|
+
* Child Matter Bridge Fork - runs in separate process
|
|
21
|
+
*/
|
|
22
|
+
export class ChildMatterBridgeFork {
|
|
23
|
+
matterServer = null;
|
|
24
|
+
api;
|
|
25
|
+
pluginManager;
|
|
26
|
+
type;
|
|
27
|
+
plugin;
|
|
28
|
+
identifier;
|
|
29
|
+
pluginConfig;
|
|
30
|
+
matterConfig;
|
|
31
|
+
_homebridgeConfig;
|
|
32
|
+
bridgeOptions;
|
|
33
|
+
accessories = new Map();
|
|
34
|
+
portRequestCallbacks = new Map();
|
|
35
|
+
constructor() {
|
|
36
|
+
// Set process title
|
|
37
|
+
process.title = 'homebridge: matter bridge';
|
|
38
|
+
// Check for debug flag in command line arguments
|
|
39
|
+
if (process.argv.includes('-D')) {
|
|
40
|
+
// Enable debug mode for this child process
|
|
41
|
+
Logger.setDebugEnabled(true);
|
|
42
|
+
}
|
|
43
|
+
// Tell parent we're ready
|
|
44
|
+
this.sendMessage(ChildMatterMessageType.READY);
|
|
45
|
+
// Handle IPC messages from parent
|
|
46
|
+
process.on('message', this.handleMessage.bind(this));
|
|
47
|
+
// Handle process termination
|
|
48
|
+
process.on('SIGTERM', () => this.shutdown());
|
|
49
|
+
process.on('SIGINT', () => this.shutdown());
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Send message to parent process
|
|
53
|
+
*/
|
|
54
|
+
sendMessage(type, data) {
|
|
55
|
+
if (process.send) {
|
|
56
|
+
process.send({
|
|
57
|
+
id: type,
|
|
58
|
+
data,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
const log = Logger.withPrefix(this.identifier || 'ChildMatterBridge');
|
|
63
|
+
log.error('Cannot send message - process.send not available');
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Handle messages from parent process
|
|
68
|
+
*/
|
|
69
|
+
async handleMessage(message) {
|
|
70
|
+
if (typeof message !== 'object' || !message.id) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
switch (message.id) {
|
|
74
|
+
case ChildMatterMessageType.LOAD:
|
|
75
|
+
await this.loadPlugin(message.data);
|
|
76
|
+
break;
|
|
77
|
+
case ChildMatterMessageType.START:
|
|
78
|
+
await this.startMatterBridge();
|
|
79
|
+
break;
|
|
80
|
+
case ChildMatterMessageType.ADD_ACCESSORY:
|
|
81
|
+
await this.addAccessory(message.data);
|
|
82
|
+
break;
|
|
83
|
+
case ChildMatterMessageType.REMOVE_ACCESSORY:
|
|
84
|
+
await this.removeAccessory(message.data);
|
|
85
|
+
break;
|
|
86
|
+
case ChildMatterMessageType.PORT_ALLOCATED:
|
|
87
|
+
this.handlePortAllocated(message.data);
|
|
88
|
+
break;
|
|
89
|
+
case ChildMatterMessageType.SHUTDOWN:
|
|
90
|
+
await this.shutdown();
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Load the plugin and configuration
|
|
96
|
+
*/
|
|
97
|
+
async loadPlugin(data) {
|
|
98
|
+
this.type = data.type;
|
|
99
|
+
this.identifier = data.identifier;
|
|
100
|
+
this.pluginConfig = data.pluginConfig;
|
|
101
|
+
this.matterConfig = data.matterConfig;
|
|
102
|
+
this._homebridgeConfig = data.homebridgeConfig;
|
|
103
|
+
this.bridgeOptions = data.bridgeOptions;
|
|
104
|
+
// Remove the _matter key from plugin config
|
|
105
|
+
delete this.pluginConfig._matter;
|
|
106
|
+
// Set up logging
|
|
107
|
+
if (this.bridgeOptions.noLogTimestamps) {
|
|
108
|
+
Logger.setTimestampEnabled(false);
|
|
109
|
+
}
|
|
110
|
+
if (this.bridgeOptions.debugModeEnabled) {
|
|
111
|
+
Logger.setDebugEnabled(true);
|
|
112
|
+
}
|
|
113
|
+
if (this.bridgeOptions.forceColourLogging) {
|
|
114
|
+
Logger.forceColor();
|
|
115
|
+
}
|
|
116
|
+
if (this.bridgeOptions.customStoragePath) {
|
|
117
|
+
User.setStoragePath(this.bridgeOptions.customStoragePath);
|
|
118
|
+
}
|
|
119
|
+
// Initialize HAP-NodeJS storage
|
|
120
|
+
HAPStorage.setCustomStoragePath(User.persistPath());
|
|
121
|
+
// Create API and plugin manager
|
|
122
|
+
this.api = new HomebridgeAPI();
|
|
123
|
+
this.pluginManager = new PluginManager(this.api);
|
|
124
|
+
// Load the plugin
|
|
125
|
+
this.plugin = this.pluginManager.loadPlugin(data.pluginPath);
|
|
126
|
+
await this.plugin.load();
|
|
127
|
+
await this.pluginManager.initializePlugin(this.plugin, data.identifier);
|
|
128
|
+
// Update process title
|
|
129
|
+
process.title = `homebridge: ${this.plugin.getPluginIdentifier()} matter`;
|
|
130
|
+
// Send loaded message
|
|
131
|
+
this.sendMessage(ChildMatterMessageType.LOADED, {
|
|
132
|
+
version: this.plugin.version,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Start the Matter bridge
|
|
137
|
+
*/
|
|
138
|
+
async startMatterBridge() {
|
|
139
|
+
try {
|
|
140
|
+
const log = Logger.withPrefix(this.matterConfig.name || this.identifier);
|
|
141
|
+
log.info('Starting Matter bridge in child process...');
|
|
142
|
+
log.debug('Matter config:', JSON.stringify(this.matterConfig));
|
|
143
|
+
// Create Matter server with proper storage path
|
|
144
|
+
const storagePath = User.storagePath();
|
|
145
|
+
this.matterServer = new MatterServer({
|
|
146
|
+
port: this.matterConfig.port,
|
|
147
|
+
name: this.matterConfig.name,
|
|
148
|
+
uniqueId: `${this.identifier}-matter`,
|
|
149
|
+
storagePath,
|
|
150
|
+
});
|
|
151
|
+
// Start the server
|
|
152
|
+
await this.matterServer.start();
|
|
153
|
+
const info = this.matterServer.getInfo();
|
|
154
|
+
const commissioningInfo = this.matterServer.getCommissioningInfo();
|
|
155
|
+
log.success(`Matter bridge started on port ${info.port}`);
|
|
156
|
+
log.debug('Matter server info:', JSON.stringify(info));
|
|
157
|
+
log.debug('Commissioning info:', JSON.stringify(commissioningInfo));
|
|
158
|
+
// Send online status with QR code
|
|
159
|
+
const onlineMessage = {
|
|
160
|
+
status: 'ok',
|
|
161
|
+
port: info.port,
|
|
162
|
+
serialNumber: info.serialNumber,
|
|
163
|
+
deviceCount: this.accessories.size,
|
|
164
|
+
commissioned: info.commissioned,
|
|
165
|
+
qrCode: commissioningInfo.qrCode,
|
|
166
|
+
manualPairingCode: commissioningInfo.manualPairingCode,
|
|
167
|
+
};
|
|
168
|
+
log.debug('Sending ONLINE message:', JSON.stringify(onlineMessage));
|
|
169
|
+
this.sendMessage(ChildMatterMessageType.ONLINE, onlineMessage);
|
|
170
|
+
// If this is a platform, initialize it to get accessories
|
|
171
|
+
if (this.type === "platform" /* PluginType.PLATFORM */) {
|
|
172
|
+
await this.initializePlatform();
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
catch (error) {
|
|
176
|
+
const log = Logger.withPrefix(this.identifier);
|
|
177
|
+
log.error('Failed to start Matter bridge:', error);
|
|
178
|
+
log.error('Stack trace:', error.stack);
|
|
179
|
+
// Send more detailed error info
|
|
180
|
+
this.sendMessage(ChildMatterMessageType.STATUS_UPDATE, {
|
|
181
|
+
status: 'down',
|
|
182
|
+
deviceCount: 0,
|
|
183
|
+
error: `${error.message}\n${error.stack}`,
|
|
184
|
+
});
|
|
185
|
+
// Also send a failure message so parent knows startup failed
|
|
186
|
+
this.sendMessage(ChildMatterMessageType.ERROR, {
|
|
187
|
+
message: error.message,
|
|
188
|
+
stack: error.stack,
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Initialize platform to get accessories
|
|
194
|
+
*/
|
|
195
|
+
async initializePlatform() {
|
|
196
|
+
if (this.type !== "platform" /* PluginType.PLATFORM */) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
// Ensure we have a platform config
|
|
200
|
+
const platformConfig = this.pluginConfig;
|
|
201
|
+
if (!platformConfig.platform) {
|
|
202
|
+
const log = Logger.withPrefix(this.identifier);
|
|
203
|
+
log.error('Platform configuration missing platform identifier');
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
const platformConstructor = this.plugin.getPlatformConstructor(platformConfig.platform);
|
|
207
|
+
const logger = Logger.withPrefix(platformConfig.name || this.identifier);
|
|
208
|
+
// Initialize the platform - it will emit events through the API
|
|
209
|
+
// We don't need to store the instance as it manages itself through events
|
|
210
|
+
void new platformConstructor(logger, platformConfig, this.api);
|
|
211
|
+
// Listen for accessory registration
|
|
212
|
+
this.api.on("registerPlatformAccessories" /* InternalAPIEvent.REGISTER_PLATFORM_ACCESSORIES */, (accessories) => {
|
|
213
|
+
accessories.forEach(accessory => this.addAccessoryToMatter(accessory));
|
|
214
|
+
});
|
|
215
|
+
this.api.on("unregisterPlatformAccessories" /* InternalAPIEvent.UNREGISTER_PLATFORM_ACCESSORIES */, (accessories) => {
|
|
216
|
+
accessories.forEach(accessory => this.removeAccessoryFromMatter(accessory));
|
|
217
|
+
});
|
|
218
|
+
// Signal API finished
|
|
219
|
+
this.api.signalFinished();
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Add an accessory to the Matter bridge
|
|
223
|
+
*/
|
|
224
|
+
async addAccessory(data) {
|
|
225
|
+
// Deserialize the accessory
|
|
226
|
+
const accessory = PlatformAccessory.deserialize(data.accessory);
|
|
227
|
+
await this.addAccessoryToMatter(accessory);
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Add accessory to Matter server
|
|
231
|
+
*/
|
|
232
|
+
async addAccessoryToMatter(accessory) {
|
|
233
|
+
if (!this.matterServer) {
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
const log = Logger.withPrefix(this.identifier);
|
|
237
|
+
try {
|
|
238
|
+
const device = await this.matterServer.addAccessory(accessory);
|
|
239
|
+
if (device) {
|
|
240
|
+
this.accessories.set(accessory.UUID, accessory);
|
|
241
|
+
log.info(`Added ${accessory.displayName} to Matter bridge`);
|
|
242
|
+
// Send status update with commissioning info
|
|
243
|
+
const commissioningInfo = this.matterServer.getCommissioningInfo();
|
|
244
|
+
this.sendMessage(ChildMatterMessageType.STATUS_UPDATE, {
|
|
245
|
+
status: 'ok',
|
|
246
|
+
deviceCount: this.accessories.size,
|
|
247
|
+
qrCode: commissioningInfo.qrCode,
|
|
248
|
+
manualPairingCode: commissioningInfo.manualPairingCode,
|
|
249
|
+
commissioned: commissioningInfo.commissioned,
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
catch (error) {
|
|
254
|
+
log.error(`Failed to add accessory ${accessory.displayName}:`, error);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Remove an accessory from the Matter bridge
|
|
259
|
+
*/
|
|
260
|
+
async removeAccessory(data) {
|
|
261
|
+
const accessory = PlatformAccessory.deserialize(data.accessory);
|
|
262
|
+
await this.removeAccessoryFromMatter(accessory);
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Remove accessory from Matter server
|
|
266
|
+
*/
|
|
267
|
+
async removeAccessoryFromMatter(accessory) {
|
|
268
|
+
if (!this.matterServer) {
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
const log = Logger.withPrefix(this.identifier);
|
|
272
|
+
try {
|
|
273
|
+
await this.matterServer.removeAccessory(accessory);
|
|
274
|
+
this.accessories.delete(accessory.UUID);
|
|
275
|
+
log.info(`Removed ${accessory.displayName} from Matter bridge`);
|
|
276
|
+
// Send status update with commissioning info
|
|
277
|
+
const commissioningInfo = this.matterServer.getCommissioningInfo();
|
|
278
|
+
this.sendMessage(ChildMatterMessageType.STATUS_UPDATE, {
|
|
279
|
+
status: 'ok',
|
|
280
|
+
deviceCount: this.accessories.size,
|
|
281
|
+
qrCode: commissioningInfo.qrCode,
|
|
282
|
+
manualPairingCode: commissioningInfo.manualPairingCode,
|
|
283
|
+
commissioned: commissioningInfo.commissioned,
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
catch (error) {
|
|
287
|
+
log.error(`Failed to remove accessory ${accessory.displayName}:`, error);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Request a port from the parent process
|
|
292
|
+
*/
|
|
293
|
+
async requestPort(identifier) {
|
|
294
|
+
return new Promise((resolve) => {
|
|
295
|
+
this.portRequestCallbacks.set(identifier, resolve);
|
|
296
|
+
this.sendMessage(ChildMatterMessageType.PORT_REQUEST, {
|
|
297
|
+
identifier,
|
|
298
|
+
});
|
|
299
|
+
// Timeout after 5 seconds
|
|
300
|
+
setTimeout(() => {
|
|
301
|
+
if (this.portRequestCallbacks.has(identifier)) {
|
|
302
|
+
this.portRequestCallbacks.delete(identifier);
|
|
303
|
+
resolve(undefined);
|
|
304
|
+
}
|
|
305
|
+
}, 5000);
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Handle port allocation response
|
|
310
|
+
*/
|
|
311
|
+
handlePortAllocated(data) {
|
|
312
|
+
const callbacks = Array.from(this.portRequestCallbacks.values());
|
|
313
|
+
this.portRequestCallbacks.clear();
|
|
314
|
+
callbacks.forEach(callback => callback(data.port));
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Shutdown the child process
|
|
318
|
+
*/
|
|
319
|
+
async shutdown() {
|
|
320
|
+
const log = Logger.withPrefix(this.identifier);
|
|
321
|
+
log.info('Shutting down Matter bridge child process...');
|
|
322
|
+
if (this.matterServer) {
|
|
323
|
+
await this.matterServer.stop();
|
|
324
|
+
}
|
|
325
|
+
process.exit(0);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
// Start the child process
|
|
329
|
+
void new ChildMatterBridgeFork();
|
|
330
|
+
//# sourceMappingURL=childMatterBridgeFork.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"childMatterBridgeFork.js","sourceRoot":"","sources":["../src/childMatterBridgeFork.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,OAAO,OAAO,MAAM,cAAc,CAAA;AAElC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvC,OAAO,EAAE,aAAa,EAAgC,MAAM,UAAU,CAAA;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAA;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CA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M,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAA;QAChC,CAAC;QAED,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;CACF;AAED,0BAA0B;AAC1B,KAAK,IAAI,qBAAqB,EAAE,CAAA"}
|
|
@@ -0,0 +1,166 @@
|
|
|
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 type { HomebridgeAPI } from './api.js';
|
|
8
|
+
import type { AccessoryConfig, HomebridgeConfig, PlatformConfig } from './bridgeService.js';
|
|
9
|
+
import type { ExternalPortService } from './externalPortService.js';
|
|
10
|
+
import type { IpcService } from './ipcService.js';
|
|
11
|
+
import type { ChildMatterConfiguration, MatterBridgeMetadata } from './matter/matterSharedTypes.js';
|
|
12
|
+
import type { Plugin } from './plugin.js';
|
|
13
|
+
import type { HomebridgeOptions } from './server.js';
|
|
14
|
+
import { PluginType } from './api.js';
|
|
15
|
+
import { PlatformAccessory } from './platformAccessory.js';
|
|
16
|
+
export { ChildMatterConfiguration } from './matter/matterSharedTypes.js';
|
|
17
|
+
export { MatterBridgeStatus as ChildMatterBridgeStatus } from './matter/matterSharedTypes.js';
|
|
18
|
+
export { MatterBridgeMetadata as ChildMatterMetadata } from './matter/matterSharedTypes.js';
|
|
19
|
+
/**
|
|
20
|
+
* Manages Matter bridges for child plugins/accessories.
|
|
21
|
+
* Each instance represents a separate Matter bridge for a specific plugin configuration.
|
|
22
|
+
*/
|
|
23
|
+
export declare class ChildMatterBridgeService {
|
|
24
|
+
type: PluginType;
|
|
25
|
+
plugin: Plugin;
|
|
26
|
+
matterConfig: ChildMatterConfiguration;
|
|
27
|
+
private pluginConfig;
|
|
28
|
+
private api;
|
|
29
|
+
private externalPortService;
|
|
30
|
+
private homebridgeOptions;
|
|
31
|
+
private ipcService?;
|
|
32
|
+
private homebridgeConfig?;
|
|
33
|
+
private child?;
|
|
34
|
+
private status;
|
|
35
|
+
private readonly accessories;
|
|
36
|
+
private log;
|
|
37
|
+
private readonly displayName;
|
|
38
|
+
private readonly identifier;
|
|
39
|
+
private shuttingDown;
|
|
40
|
+
private childProcessReady;
|
|
41
|
+
private childBridgeStatus;
|
|
42
|
+
constructor(type: PluginType, plugin: Plugin, matterConfig: ChildMatterConfiguration, pluginConfig: PlatformConfig | AccessoryConfig, api: HomebridgeAPI, externalPortService: ExternalPortService, homebridgeOptions: HomebridgeOptions, ipcService?: IpcService | undefined, homebridgeConfig?: HomebridgeConfig | undefined);
|
|
43
|
+
/**
|
|
44
|
+
* Start the child Matter bridge
|
|
45
|
+
*/
|
|
46
|
+
start(): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Start Matter bridge in child process
|
|
49
|
+
*/
|
|
50
|
+
private startChildProcess;
|
|
51
|
+
/**
|
|
52
|
+
* Wait for child process to be ready
|
|
53
|
+
*/
|
|
54
|
+
private waitForChildReady;
|
|
55
|
+
/**
|
|
56
|
+
* Send plugin configuration to child
|
|
57
|
+
*/
|
|
58
|
+
private loadChildPlugin;
|
|
59
|
+
/**
|
|
60
|
+
* Start Matter bridge in child process
|
|
61
|
+
*/
|
|
62
|
+
private startChildMatterBridge;
|
|
63
|
+
/**
|
|
64
|
+
* Handle messages from child process
|
|
65
|
+
*/
|
|
66
|
+
private handleChildMessage;
|
|
67
|
+
/**
|
|
68
|
+
* Handle port request from child
|
|
69
|
+
*/
|
|
70
|
+
private handlePortRequest;
|
|
71
|
+
/**
|
|
72
|
+
* Send message to child process
|
|
73
|
+
*/
|
|
74
|
+
private sendToChild;
|
|
75
|
+
/**
|
|
76
|
+
* Add an accessory to the child Matter bridge
|
|
77
|
+
*/
|
|
78
|
+
addAccessory(accessory: PlatformAccessory): Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* Remove an accessory from the child Matter bridge
|
|
81
|
+
*/
|
|
82
|
+
removeAccessory(accessory: PlatformAccessory): Promise<void>;
|
|
83
|
+
/**
|
|
84
|
+
* Get metadata about this child Matter bridge
|
|
85
|
+
*/
|
|
86
|
+
getMetadata(): MatterBridgeMetadata;
|
|
87
|
+
/**
|
|
88
|
+
* Get Matter accessories for this child bridge
|
|
89
|
+
*/
|
|
90
|
+
getMatterAccessories(): {
|
|
91
|
+
uuid: string;
|
|
92
|
+
displayName: string;
|
|
93
|
+
category: import("hap-nodejs").Categories;
|
|
94
|
+
services: {
|
|
95
|
+
type: string;
|
|
96
|
+
subtype: string | undefined;
|
|
97
|
+
displayName: string;
|
|
98
|
+
characteristics: {
|
|
99
|
+
type: string;
|
|
100
|
+
value: import("hap-nodejs").Nullable<import("hap-nodejs").CharacteristicValue>;
|
|
101
|
+
props: import("hap-nodejs").CharacteristicProps;
|
|
102
|
+
}[];
|
|
103
|
+
}[];
|
|
104
|
+
matterInfo: {
|
|
105
|
+
bridged: boolean;
|
|
106
|
+
childBridge: string;
|
|
107
|
+
};
|
|
108
|
+
}[];
|
|
109
|
+
/**
|
|
110
|
+
* Stop the child Matter bridge
|
|
111
|
+
*/
|
|
112
|
+
teardown(permanent?: boolean): Promise<void>;
|
|
113
|
+
/**
|
|
114
|
+
* Clean up Matter storage when bridge is permanently removed
|
|
115
|
+
*/
|
|
116
|
+
private cleanupMatterStorage;
|
|
117
|
+
/**
|
|
118
|
+
* Restart the child Matter bridge
|
|
119
|
+
*/
|
|
120
|
+
restart(): Promise<void>;
|
|
121
|
+
/**
|
|
122
|
+
* Restart child bridge (IPC interface)
|
|
123
|
+
*/
|
|
124
|
+
restartChildBridge(): Promise<void>;
|
|
125
|
+
/**
|
|
126
|
+
* Stop child bridge (IPC interface)
|
|
127
|
+
*/
|
|
128
|
+
stopChildBridge(): Promise<void>;
|
|
129
|
+
/**
|
|
130
|
+
* Start child bridge (IPC interface)
|
|
131
|
+
*/
|
|
132
|
+
startChildBridge(): Promise<void>;
|
|
133
|
+
/**
|
|
134
|
+
* Allocate a port for the Matter bridge
|
|
135
|
+
*/
|
|
136
|
+
private allocatePort;
|
|
137
|
+
/**
|
|
138
|
+
* Check if a port is available
|
|
139
|
+
*/
|
|
140
|
+
private isPortAvailable;
|
|
141
|
+
/**
|
|
142
|
+
* Send status update via IPC
|
|
143
|
+
*/
|
|
144
|
+
private sendStatusUpdate;
|
|
145
|
+
/**
|
|
146
|
+
* Check if the bridge is running
|
|
147
|
+
*/
|
|
148
|
+
isRunning(): boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Get the plugin identifier
|
|
151
|
+
*/
|
|
152
|
+
getPluginIdentifier(): string;
|
|
153
|
+
/**
|
|
154
|
+
* Get the display name
|
|
155
|
+
*/
|
|
156
|
+
getDisplayName(): string;
|
|
157
|
+
/**
|
|
158
|
+
* Get commissioning info for the Matter bridge
|
|
159
|
+
*/
|
|
160
|
+
getCommissioningInfo(): {
|
|
161
|
+
qrCode?: string;
|
|
162
|
+
manualPairingCode?: string;
|
|
163
|
+
commissioned: boolean;
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=childMatterBridgeService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"childMatterBridgeService.d.ts","sourceRoot":"","sources":["../src/childMatterBridgeService.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAC3F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,KAAK,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAA;AACnG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aA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