matterbridge 1.3.7 → 1.3.9
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/CHANGELOG.md +19 -0
- package/dist/cluster/ElectricalPowerMeasurementCluster.js +4 -4
- package/dist/cluster/ElectricalPowerMeasurementCluster.js.map +1 -1
- package/dist/matterbridge.d.ts +2 -5
- package/dist/matterbridge.d.ts.map +1 -1
- package/dist/matterbridge.js +17 -27
- package/dist/matterbridge.js.map +1 -1
- package/package.json +3 -3
- package/dist/matterbridgeDeviceV8.d.ts +0 -42
- package/dist/matterbridgeDeviceV8.d.ts.map +0 -1
- package/dist/matterbridgeDeviceV8.js +0 -123
- package/dist/matterbridgeDeviceV8.js.map +0 -1
- package/dist/matterbridgeV8.d.ts +0 -141
- package/dist/matterbridgeV8.d.ts.map +0 -1
- package/dist/matterbridgeV8.js +0 -641
- package/dist/matterbridgeV8.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "matterbridge",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.9",
|
|
4
4
|
"description": "Matterbridge plugin manager for Matter",
|
|
5
5
|
"author": "https://github.com/Luligu",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
"prettier": "^3.3.2",
|
|
133
133
|
"rimraf": "^5.0.7",
|
|
134
134
|
"ts-jest": "^29.1.5",
|
|
135
|
-
"typescript": "^5.5.
|
|
136
|
-
"typescript-eslint": "^7.
|
|
135
|
+
"typescript": "^5.5.3",
|
|
136
|
+
"typescript-eslint": "^7.15.0"
|
|
137
137
|
}
|
|
138
138
|
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { Endpoint } from '@project-chip/matter.js/endpoint';
|
|
2
|
-
import { DeviceTypeDefinition, EndpointOptions } from '@project-chip/matter-node.js/device';
|
|
3
|
-
import { AtLeastOne } from '@project-chip/matter-node.js/util';
|
|
4
|
-
import { ClusterId } from '@project-chip/matter-node.js/datatype';
|
|
5
|
-
import { AnsiLogger } from 'node-ansi-logger';
|
|
6
|
-
export declare class MatterbridgeDeviceV8 extends Endpoint {
|
|
7
|
-
static bridgeMode: string;
|
|
8
|
-
log: AnsiLogger;
|
|
9
|
-
serialNumber: string | undefined;
|
|
10
|
-
deviceName: string | undefined;
|
|
11
|
-
uniqueId: string | undefined;
|
|
12
|
-
deviceTypes: DeviceTypeDefinition[];
|
|
13
|
-
/**
|
|
14
|
-
* Represents a Matterbridge device.
|
|
15
|
-
* @constructor
|
|
16
|
-
* @param {DeviceTypeDefinition} definition - The definition of the device.
|
|
17
|
-
* @param {EndpointOptions} [options={}] - The options for the device.
|
|
18
|
-
*/
|
|
19
|
-
constructor(definition: DeviceTypeDefinition, options?: EndpointOptions);
|
|
20
|
-
/**
|
|
21
|
-
* Loads an instance of the MatterbridgeDevice class.
|
|
22
|
-
*
|
|
23
|
-
* @param {DeviceTypeDefinition} definition - The DeviceTypeDefinition of the device.
|
|
24
|
-
* @returns MatterbridgeDevice instance.
|
|
25
|
-
*/
|
|
26
|
-
static loadInstance(definition: DeviceTypeDefinition, options?: EndpointOptions): Promise<MatterbridgeDeviceV8>;
|
|
27
|
-
/**
|
|
28
|
-
* Adds a device type to the list of device types.
|
|
29
|
-
* If the device type is not already present in the list, it will be added.
|
|
30
|
-
*
|
|
31
|
-
* @param {DeviceTypeDefinition} deviceType - The device type to add.
|
|
32
|
-
*/
|
|
33
|
-
addDeviceType(deviceType: DeviceTypeDefinition): void;
|
|
34
|
-
/**
|
|
35
|
-
* Adds one or more device types with the required cluster servers and the specified cluster servers.
|
|
36
|
-
*
|
|
37
|
-
* @param {AtLeastOne<DeviceTypeDefinition>} deviceTypes - The device types to add.
|
|
38
|
-
* @param {ClusterId[]} includeServerList - The list of cluster IDs to include.
|
|
39
|
-
*/
|
|
40
|
-
addDeviceTypeWithClusterServer(deviceTypes: AtLeastOne<DeviceTypeDefinition>, includeServerList: ClusterId[]): void;
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=matterbridgeDeviceV8.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"matterbridgeDeviceV8.d.ts","sourceRoot":"","sources":["../src/matterbridgeDeviceV8.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAkB,MAAM,kCAAkC,CAAC;AAe5E,OAAO,EAAE,oBAAoB,EAAe,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEzG,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAGlE,OAAO,EAAE,UAAU,EAA+B,MAAM,kBAAkB,CAAC;AAE3E,qBAAa,oBAAqB,SAAQ,QAAQ;IAChD,OAAc,UAAU,SAAM;IAC9B,GAAG,EAAE,UAAU,CAAC;IAChB,YAAY,EAAE,MAAM,GAAG,SAAS,CAAa;IAC7C,UAAU,EAAE,MAAM,GAAG,SAAS,CAAa;IAC3C,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAa;IAGzC,WAAW,EAAE,oBAAoB,EAAE,CAAM;IAEzC;;;;;OAKG;gBACS,UAAU,EAAE,oBAAoB,EAAE,OAAO,GAAE,eAAoB;IAiD3E;;;;;OAKG;WACU,YAAY,CAAC,UAAU,EAAE,oBAAoB,EAAE,OAAO,GAAE,eAAoB;IAIzF;;;;;OAKG;IACH,aAAa,CAAC,UAAU,EAAE,oBAAoB;IAO9C;;;;;OAKG;IACH,8BAA8B,CAAC,WAAW,EAAE,UAAU,CAAC,oBAAoB,CAAC,EAAE,iBAAiB,EAAE,SAAS,EAAE;CAc7G"}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
-
// New API imports
|
|
3
|
-
import { Endpoint } from '@project-chip/matter.js/endpoint';
|
|
4
|
-
import { MutableEndpoint } from '@project-chip/matter.js/endpoint/type';
|
|
5
|
-
import { SupportedBehaviors } from '@project-chip/matter.js/endpoint/properties';
|
|
6
|
-
import { IdentifyServer } from '@project-chip/matter.js/behavior/definitions/identify';
|
|
7
|
-
import { GroupsServer } from '@project-chip/matter.js/behavior/definitions/groups';
|
|
8
|
-
import { ScenesServer } from '@project-chip/matter.js/behavior/definitions/scenes';
|
|
9
|
-
import { OnOffServer } from '@project-chip/matter.js/behavior/definitions/on-off';
|
|
10
|
-
import { TemperatureMeasurementServer } from '@project-chip/matter.js/behavior/definitions/temperature-measurement';
|
|
11
|
-
import { BridgedDeviceBasicInformationServer } from '@project-chip/matter.js/behavior/definitions/bridged-device-basic-information';
|
|
12
|
-
import { BridgedDeviceBasicInformation, Groups, Identify, OnOff, Scenes, TemperatureMeasurement, getClusterNameById } from '@project-chip/matter-node.js/cluster';
|
|
13
|
-
// Matterbridge imports
|
|
14
|
-
import { AnsiLogger, db, hk, zb } from 'node-ansi-logger';
|
|
15
|
-
export class MatterbridgeDeviceV8 extends Endpoint {
|
|
16
|
-
static bridgeMode = '';
|
|
17
|
-
log;
|
|
18
|
-
serialNumber = undefined;
|
|
19
|
-
deviceName = undefined;
|
|
20
|
-
uniqueId = undefined;
|
|
21
|
-
// TODO: Map to new API
|
|
22
|
-
deviceTypes = [];
|
|
23
|
-
/**
|
|
24
|
-
* Represents a Matterbridge device.
|
|
25
|
-
* @constructor
|
|
26
|
-
* @param {DeviceTypeDefinition} definition - The definition of the device.
|
|
27
|
-
* @param {EndpointOptions} [options={}] - The options for the device.
|
|
28
|
-
*/
|
|
29
|
-
constructor(definition, options = {}) {
|
|
30
|
-
// Map ClusterId to Behavior.Type
|
|
31
|
-
const behaviorTypes = [];
|
|
32
|
-
definition.requiredServerClusters.forEach((clusterId) => {
|
|
33
|
-
if (clusterId === Identify.Cluster.id)
|
|
34
|
-
behaviorTypes.push(IdentifyServer);
|
|
35
|
-
if (clusterId === Groups.Cluster.id)
|
|
36
|
-
behaviorTypes.push(GroupsServer);
|
|
37
|
-
if (clusterId === Scenes.Cluster.id)
|
|
38
|
-
behaviorTypes.push(ScenesServer);
|
|
39
|
-
if (clusterId === OnOff.Cluster.id)
|
|
40
|
-
behaviorTypes.push(OnOffServer);
|
|
41
|
-
if (clusterId === BridgedDeviceBasicInformation.Cluster.id)
|
|
42
|
-
behaviorTypes.push(BridgedDeviceBasicInformationServer);
|
|
43
|
-
if (clusterId === TemperatureMeasurement.Cluster.id)
|
|
44
|
-
behaviorTypes.push(TemperatureMeasurementServer);
|
|
45
|
-
});
|
|
46
|
-
// Convert the DeviceTypeDefinition to a MutableEndpoint definition with the required behaviors
|
|
47
|
-
const definitionV8 = MutableEndpoint({
|
|
48
|
-
name: definition.name.replace('-', '_'),
|
|
49
|
-
deviceType: definition.code,
|
|
50
|
-
deviceRevision: definition.revision,
|
|
51
|
-
requirements: {
|
|
52
|
-
server: {
|
|
53
|
-
mandatory: {},
|
|
54
|
-
optional: {},
|
|
55
|
-
},
|
|
56
|
-
client: {
|
|
57
|
-
mandatory: {},
|
|
58
|
-
optional: {},
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
behaviors: SupportedBehaviors(...behaviorTypes),
|
|
62
|
-
});
|
|
63
|
-
const optionsV8 = {
|
|
64
|
-
id: options.uniqueStorageKey,
|
|
65
|
-
bridgedDeviceBasicInformation: {
|
|
66
|
-
vendorId: 0xfff1,
|
|
67
|
-
vendorName: 'Metterbridge',
|
|
68
|
-
productName: 'Light',
|
|
69
|
-
productLabel: 'Light',
|
|
70
|
-
nodeLabel: 'Light',
|
|
71
|
-
serialNumber: '0x1234567869',
|
|
72
|
-
uniqueId: '0x1234567869',
|
|
73
|
-
reachable: true,
|
|
74
|
-
},
|
|
75
|
-
};
|
|
76
|
-
super(definitionV8, optionsV8);
|
|
77
|
-
this.log = new AnsiLogger({ logName: 'MatterbridgeDevice', logTimestampFormat: 4 /* TimestampFormat.TIME_MILLIS */, logDebug: true });
|
|
78
|
-
this.deviceTypes.push(definition);
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Loads an instance of the MatterbridgeDevice class.
|
|
82
|
-
*
|
|
83
|
-
* @param {DeviceTypeDefinition} definition - The DeviceTypeDefinition of the device.
|
|
84
|
-
* @returns MatterbridgeDevice instance.
|
|
85
|
-
*/
|
|
86
|
-
static async loadInstance(definition, options = {}) {
|
|
87
|
-
return new MatterbridgeDeviceV8(definition, options);
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Adds a device type to the list of device types.
|
|
91
|
-
* If the device type is not already present in the list, it will be added.
|
|
92
|
-
*
|
|
93
|
-
* @param {DeviceTypeDefinition} deviceType - The device type to add.
|
|
94
|
-
*/
|
|
95
|
-
addDeviceType(deviceType) {
|
|
96
|
-
if (!this.deviceTypes.includes(deviceType)) {
|
|
97
|
-
this.log.debug(`addDeviceType: ${zb}${deviceType.code}${db}-${zb}${deviceType.name}${db}`);
|
|
98
|
-
this.deviceTypes.push(deviceType);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Adds one or more device types with the required cluster servers and the specified cluster servers.
|
|
103
|
-
*
|
|
104
|
-
* @param {AtLeastOne<DeviceTypeDefinition>} deviceTypes - The device types to add.
|
|
105
|
-
* @param {ClusterId[]} includeServerList - The list of cluster IDs to include.
|
|
106
|
-
*/
|
|
107
|
-
addDeviceTypeWithClusterServer(deviceTypes, includeServerList) {
|
|
108
|
-
this.log.debug('addDeviceTypeWithClusterServer:');
|
|
109
|
-
deviceTypes.forEach((deviceType) => {
|
|
110
|
-
this.addDeviceType(deviceType);
|
|
111
|
-
this.log.debug(`- with deviceType: ${zb}${deviceType.code}${db}-${zb}${deviceType.name}${db}`);
|
|
112
|
-
deviceType.requiredServerClusters.forEach((clusterId) => {
|
|
113
|
-
if (!includeServerList.includes(clusterId))
|
|
114
|
-
includeServerList.push(clusterId);
|
|
115
|
-
});
|
|
116
|
-
});
|
|
117
|
-
includeServerList.forEach((clusterId) => {
|
|
118
|
-
this.log.debug(`- with cluster: ${hk}${clusterId}${db}-${hk}${getClusterNameById(clusterId)}${db}`);
|
|
119
|
-
});
|
|
120
|
-
// this.addClusterServerFromList(this, includeServerList);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
//# sourceMappingURL=matterbridgeDeviceV8.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"matterbridgeDeviceV8.js","sourceRoot":"","sources":["../src/matterbridgeDeviceV8.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,kBAAkB;AAClB,OAAO,EAAE,QAAQ,EAAkB,MAAM,kCAAkC,CAAC;AAI5E,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAExE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,EAAE,cAAc,EAAoB,MAAM,uDAAuD,CAAC;AACzG,OAAO,EAAE,YAAY,EAAkB,MAAM,qDAAqD,CAAC;AACnG,OAAO,EAAE,YAAY,EAAkB,MAAM,qDAAqD,CAAC;AACnG,OAAO,EAAE,WAAW,EAAiB,MAAM,qDAAqD,CAAC;AACjG,OAAO,EAAE,4BAA4B,EAAE,MAAM,sEAAsE,CAAC;AACpH,OAAO,EAAE,mCAAmC,EAAyC,MAAM,+EAA+E,CAAC;AAI3K,OAAO,EAAE,6BAA6B,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAIlK,uBAAuB;AACvB,OAAO,EAAE,UAAU,EAAmB,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAE3E,MAAM,OAAO,oBAAqB,SAAQ,QAAQ;IACzC,MAAM,CAAC,UAAU,GAAG,EAAE,CAAC;IAC9B,GAAG,CAAa;IAChB,YAAY,GAAuB,SAAS,CAAC;IAC7C,UAAU,G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AC;IAED;;;;;OAKG;IACH,8BAA8B,CAAC,WAA6C,EAAE,iBAA8B;QAC1G,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;QAClD,WAAW,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;YACjC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAC/B,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,sBAAsB,EAAE,GAAG,UAAU,CAAC,IAAI,GAAG,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC,IAAI,GAAG,EAAE,EAAE,CAAC,CAAC;YAC/F,UAAU,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;gBACtD,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,SAAS,CAAC;oBAAE,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAChF,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QACH,iBAAiB,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;YACtC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,mBAAmB,EAAE,GAAG,SAAS,GAAG,EAAE,IAAI,EAAE,GAAG,kBAAkB,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QACtG,CAAC,CAAC,CAAC;QACH,0DAA0D;IAC5D,CAAC"}
|
package/dist/matterbridgeV8.d.ts
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file contains the class NewMatterbridge. Test of new matter.js api
|
|
3
|
-
*
|
|
4
|
-
* @file matterbridgeNewApi.ts
|
|
5
|
-
* @author Luca Liguori
|
|
6
|
-
* @date 2024-06-01
|
|
7
|
-
* @version 1.0.0
|
|
8
|
-
*
|
|
9
|
-
* Copyright 2024 Luca Liguori.
|
|
10
|
-
*
|
|
11
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
|
-
* you may not use this file except in compliance with the License.
|
|
13
|
-
* You may obtain a copy of the License at
|
|
14
|
-
*
|
|
15
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
-
*
|
|
17
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
18
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
-
* See the License for the specific language governing permissions and
|
|
21
|
-
* limitations under the License. *
|
|
22
|
-
*/
|
|
23
|
-
/**
|
|
24
|
-
* Import needed modules from @project-chip/matter-node.js
|
|
25
|
-
*/
|
|
26
|
-
import '@project-chip/matter-node.js';
|
|
27
|
-
import { DeviceTypeId } from '@project-chip/matter-node.js/datatype';
|
|
28
|
-
import { Logger } from '@project-chip/matter-node.js/log';
|
|
29
|
-
import { Storage, StorageContext, StorageManager } from '@project-chip/matter-node.js/storage';
|
|
30
|
-
import { StorageService } from '@project-chip/matter.js/environment';
|
|
31
|
-
import { ServerNode } from '@project-chip/matter.js/node';
|
|
32
|
-
import { Endpoint } from '@project-chip/matter.js/endpoint';
|
|
33
|
-
import { AggregatorEndpoint } from '@project-chip/matter.js/endpoints/AggregatorEndpoint';
|
|
34
|
-
import EventEmitter from 'events';
|
|
35
|
-
import { MatterbridgeDeviceV8 } from './matterbridgeDeviceV8.js';
|
|
36
|
-
/**
|
|
37
|
-
* Represents the Matterbridge application.
|
|
38
|
-
*/
|
|
39
|
-
export declare class MatterbridgeV8 extends EventEmitter {
|
|
40
|
-
private environment;
|
|
41
|
-
matterbridgeVersion: string;
|
|
42
|
-
osVersion: string;
|
|
43
|
-
matterbridgeDirectory: string;
|
|
44
|
-
matterbridgePluginDirectory: string;
|
|
45
|
-
globalModulesDirectory: string;
|
|
46
|
-
matterbridgeLogFile: string;
|
|
47
|
-
private registeredPlugins;
|
|
48
|
-
private nodeStorage;
|
|
49
|
-
private nodeContext;
|
|
50
|
-
matterStorageService?: StorageService;
|
|
51
|
-
matterStorageManager?: StorageManager;
|
|
52
|
-
matterStorageContext?: StorageContext;
|
|
53
|
-
matterServerNode?: ServerNode<ServerNode.RootEndpoint>;
|
|
54
|
-
matterAggregator?: Endpoint<AggregatorEndpoint>;
|
|
55
|
-
matterLogger?: Logger;
|
|
56
|
-
private constructor();
|
|
57
|
-
static create(): Promise<MatterbridgeV8>;
|
|
58
|
-
initialize(): Promise<void>;
|
|
59
|
-
private setupMatterVars;
|
|
60
|
-
private setupMatterStorage;
|
|
61
|
-
private setupNodeStorage;
|
|
62
|
-
private deleteMatterLogfile;
|
|
63
|
-
private setupMatterFileLogger;
|
|
64
|
-
/**
|
|
65
|
-
* Creates a server node storage context.
|
|
66
|
-
*
|
|
67
|
-
* @param pluginName - The name of the plugin.
|
|
68
|
-
* @param deviceName - The name of the device.
|
|
69
|
-
* @param deviceType - The deviceType of the device.
|
|
70
|
-
* @param vendorId - The vendor ID.
|
|
71
|
-
* @param vendorName - The vendor name.
|
|
72
|
-
* @param productId - The product ID.
|
|
73
|
-
* @param productName - The product name.
|
|
74
|
-
* @param serialNumber - The serial number of the device (optional).
|
|
75
|
-
* @param uniqueId - The unique ID of the device (optional).
|
|
76
|
-
* @param softwareVersion - The software version of the device (optional).
|
|
77
|
-
* @param softwareVersionString - The software version string of the device (optional).
|
|
78
|
-
* @param hardwareVersion - The hardware version of the device (optional).
|
|
79
|
-
* @param hardwareVersionString - The hardware version string of the device (optional).
|
|
80
|
-
* @returns The storage context for the commissioning server.
|
|
81
|
-
*/
|
|
82
|
-
createServerNodeContext(pluginName: string, deviceName: string, deviceType: DeviceTypeId, vendorId: number, vendorName: string, productId: number, productName: string, serialNumber?: string): Promise<StorageContext<Storage>>;
|
|
83
|
-
createServerNode(storageContext: StorageContext<Storage>, port?: number, passcode?: number, discriminator?: number): Promise<ServerNode<ServerNode.RootEndpoint>>;
|
|
84
|
-
showServerNodeQR(): void;
|
|
85
|
-
stopServerNode(): Promise<void>;
|
|
86
|
-
createAggregator(storageContext: StorageContext<Storage>): Promise<Endpoint<AggregatorEndpoint>>;
|
|
87
|
-
startBridge(): Promise<void>;
|
|
88
|
-
startChildbridge(): Promise<void>;
|
|
89
|
-
startController(): Promise<void>;
|
|
90
|
-
/**
|
|
91
|
-
* Adds a bridged device to the Matterbridge.
|
|
92
|
-
* @param pluginName - The name of the plugin.
|
|
93
|
-
* @param device - The bridged device to add.
|
|
94
|
-
* @returns {Promise<void>} - A promise that resolves when the storage process is started.
|
|
95
|
-
*/
|
|
96
|
-
addBridgedDevice(pluginName: string, device: MatterbridgeDeviceV8): Promise<void>;
|
|
97
|
-
/**
|
|
98
|
-
* Loads a plugin and returns the corresponding MatterbridgePlatform instance.
|
|
99
|
-
* @param plugin - The plugin to load.
|
|
100
|
-
* @param start - Optional flag indicating whether to start the plugin after loading. Default is false.
|
|
101
|
-
* @param message - Optional message to pass to the plugin when starting.
|
|
102
|
-
* @returns A Promise that resolves to the loaded MatterbridgePlatform instance.
|
|
103
|
-
* @throws An error if the plugin is not enabled, already loaded, or fails to load.
|
|
104
|
-
*/
|
|
105
|
-
private loadPlugin;
|
|
106
|
-
/**
|
|
107
|
-
* Starts a plugin.
|
|
108
|
-
*
|
|
109
|
-
* @param {RegisteredPlugin} plugin - The plugin to start.
|
|
110
|
-
* @param {string} [message] - Optional message to pass to the plugin's onStart method.
|
|
111
|
-
* @param {boolean} [configure=false] - Indicates whether to configure the plugin after starting.
|
|
112
|
-
* @returns {Promise<void>} A promise that resolves when the plugin is started successfully, or rejects with an error if starting the plugin fails.
|
|
113
|
-
*/
|
|
114
|
-
private startPlugin;
|
|
115
|
-
/**
|
|
116
|
-
* Configures a plugin.
|
|
117
|
-
*
|
|
118
|
-
* @param {RegisteredPlugin} plugin - The plugin to configure.
|
|
119
|
-
* @returns {Promise<void>} A promise that resolves when the plugin is configured successfully, or rejects with an error if configuration fails.
|
|
120
|
-
*/
|
|
121
|
-
private configurePlugin;
|
|
122
|
-
/**
|
|
123
|
-
* Loads the configuration for a plugin.
|
|
124
|
-
* If the configuration file exists, it reads the file and returns the parsed JSON data.
|
|
125
|
-
* If the configuration file does not exist, it creates a new file with default configuration and returns it.
|
|
126
|
-
* If any error occurs during file access or creation, it logs an error and rejects the promise with the error.
|
|
127
|
-
*
|
|
128
|
-
* @param plugin - The plugin for which to load the configuration.
|
|
129
|
-
* @returns A promise that resolves to the loaded or created configuration.
|
|
130
|
-
*/
|
|
131
|
-
private loadPluginConfig;
|
|
132
|
-
/**
|
|
133
|
-
* Writes data to a file.
|
|
134
|
-
*
|
|
135
|
-
* @param {string} filePath - The path of the file to write to.
|
|
136
|
-
* @param {string} data - The data to write to the file.
|
|
137
|
-
* @returns {Promise<void>} - A promise that resolves when the data is successfully written to the file.
|
|
138
|
-
*/
|
|
139
|
-
private writeFile;
|
|
140
|
-
}
|
|
141
|
-
//# sourceMappingURL=matterbridgeV8.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"matterbridgeV8.d.ts","sourceRoot":"","sources":["../src/matterbridgeV8.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;GAEG;AAEH,OAAO,8BAA8B,CAAC;AAEtC,OAAO,EAAE,YAAY,EAAyB,MAAM,uCAAuC,CAAC;AAC5F,OAAO,EAAiB,MAAM,EAAoB,MAAM,kCAAkC,CAAC;AAC3F,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAC/F,OAAO,EAAe,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAI1D,OAAO,EAAE,QAAQ,EAAkB,MAAM,kCAAkC,CAAC;AAG5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sDAAsD,CAAC;AA0B1F,OAAO,YAAY,MAAM,QAAQ,CAAC;AAGlC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAcj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