matterbridge 1.1.9 → 1.1.11
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 +17 -0
- package/README.md +20 -4
- package/dist/cli.js +20 -4
- package/dist/cli.js.map +1 -1
- package/dist/matterbridge.d.ts +35 -2
- package/dist/matterbridge.d.ts.map +1 -1
- package/dist/matterbridge.js +293 -51
- package/dist/matterbridge.js.map +1 -1
- package/dist/matterbridgeAccessoryPlatform.d.ts +9 -0
- package/dist/matterbridgeAccessoryPlatform.d.ts.map +1 -1
- package/dist/matterbridgeAccessoryPlatform.js +13 -0
- package/dist/matterbridgeAccessoryPlatform.js.map +1 -1
- package/dist/matterbridgeDevice.d.ts +3 -2
- package/dist/matterbridgeDevice.d.ts.map +1 -1
- package/dist/matterbridgeDevice.js +80 -20
- package/dist/matterbridgeDevice.js.map +1 -1
- package/dist/matterbridgeDynamicPlatform.d.ts +9 -0
- package/dist/matterbridgeDynamicPlatform.d.ts.map +1 -1
- package/dist/matterbridgeDynamicPlatform.js +13 -0
- package/dist/matterbridgeDynamicPlatform.js.map +1 -1
- package/frontend/build/asset-manifest.json +6 -6
- package/frontend/build/index.html +1 -1
- package/frontend/build/static/css/main.70102d98.css +2 -0
- package/frontend/build/static/css/main.70102d98.css.map +1 -0
- package/frontend/build/static/js/main.5d39b100.js +3 -0
- package/frontend/build/static/js/main.5d39b100.js.map +1 -0
- package/package.json +9 -6
- package/frontend/build/static/css/main.ce1ee9e7.css +0 -2
- package/frontend/build/static/css/main.ce1ee9e7.css.map +0 -1
- package/frontend/build/static/js/main.cc840fb3.js +0 -3
- package/frontend/build/static/js/main.cc840fb3.js.map +0 -1
- /package/frontend/build/static/js/{main.cc840fb3.js.LICENSE.txt → main.5d39b100.js.LICENSE.txt} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,11 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.1.11] - 2024-03-15
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- [frontend]: Frontend got updated to 0.8.3.
|
|
10
|
+
|
|
11
|
+
## [1.1.10] - 2024-03-15
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- [matterbridge]: added unregisterAllDevices() to the platforms
|
|
16
|
+
- [matterbridge]: added unregisterDevice(device: MatterbridgeDevice) to the platforms
|
|
17
|
+
- [frontend]: Enable and disable plugin are now available. Restart Matteerbridge after.
|
|
18
|
+
- [frontend]: Frontend got updated to 0.8.2.
|
|
19
|
+
|
|
5
20
|
## [1.1.9] - 2024-03-15
|
|
6
21
|
|
|
7
22
|
### Added
|
|
8
23
|
|
|
24
|
+
- [frontend]: Selecting a plugin in the home page show the corresponding QR code.
|
|
9
25
|
- [frontend]: Settings page now controll the global logger level.
|
|
26
|
+
- [frontend]: Restart from the header is available.
|
|
10
27
|
- [frontend]: Frontend got updated to 0.8.1.
|
|
11
28
|
|
|
12
29
|
## [1.1.8] - 2024-03-15
|
package/README.md
CHANGED
|
@@ -174,21 +174,37 @@ The easiest way is to clone:
|
|
|
174
174
|
|
|
175
175
|
Then change the name, version, description and author in the package.json.
|
|
176
176
|
|
|
177
|
-
Add your plugin logic in platform.ts
|
|
177
|
+
Add your plugin logic in platform.ts.
|
|
178
178
|
|
|
179
|
-
|
|
179
|
+
## MatterbridgeDynamicPlatform and MatterbridgeAccessoryPlatform api
|
|
180
|
+
|
|
181
|
+
### async onStart(reason?: string)
|
|
180
182
|
The method onStart() is where you have to create your MatterbridgeDevice and add all needed clusters and command handlers.
|
|
181
183
|
|
|
182
184
|
The MatterbridgeDevice class has the create cluster methods already done and all command handlers needed (see plugin examples).
|
|
183
185
|
|
|
184
186
|
The method is called when Matterbridge load the plugin.
|
|
185
187
|
|
|
186
|
-
### onConfigure()
|
|
188
|
+
### async onConfigure()
|
|
187
189
|
The method onConfigure() is where you can configure or initialize your device.
|
|
188
190
|
|
|
189
191
|
The method is called when the platform is commissioned.
|
|
190
192
|
|
|
191
|
-
### onShutdown(reason?: string)
|
|
193
|
+
### async onShutdown(reason?: string)
|
|
192
194
|
The method onShutdown() is where you have to eventually cleanup some resources.
|
|
193
195
|
|
|
194
196
|
The method is called when Matterbridge is shutting down.
|
|
197
|
+
|
|
198
|
+
### async registerDevice(device: MatterbridgeDevice)
|
|
199
|
+
After you created your device, add it to the platform.
|
|
200
|
+
|
|
201
|
+
### async unregisterDevice(device: MatterbridgeDevice)
|
|
202
|
+
You can unregister one or more device.
|
|
203
|
+
|
|
204
|
+
### async unregisterAllDevices()
|
|
205
|
+
You can unregister all devices you added.
|
|
206
|
+
|
|
207
|
+
It can me be useful to call this method from onShutdown if you don't want to keep all the devices.
|
|
208
|
+
|
|
209
|
+
## MatterbridgeDevice api
|
|
210
|
+
|
package/dist/cli.js
CHANGED
|
@@ -21,17 +21,33 @@
|
|
|
21
21
|
* See the License for the specific language governing permissions and
|
|
22
22
|
* limitations under the License. *
|
|
23
23
|
*/
|
|
24
|
+
/* eslint-disable no-console */
|
|
25
|
+
//import wtf from 'wtfnode';
|
|
24
26
|
import { Matterbridge } from './matterbridge.js';
|
|
27
|
+
let instance;
|
|
25
28
|
async function main() {
|
|
26
|
-
// eslint-disable-next-line no-console
|
|
27
29
|
console.log('CLI: Matterbridge.loadInstance() called');
|
|
28
|
-
await Matterbridge.loadInstance(true);
|
|
29
|
-
|
|
30
|
+
instance = await Matterbridge.loadInstance(true);
|
|
31
|
+
registerHandlers();
|
|
30
32
|
console.log('CLI: Matterbridge.loadInstance() exited');
|
|
31
33
|
}
|
|
34
|
+
function registerHandlers() {
|
|
35
|
+
instance.on('shutdown', async () => shutdown());
|
|
36
|
+
instance.on('restart', async () => restart());
|
|
37
|
+
}
|
|
38
|
+
async function shutdown() {
|
|
39
|
+
console.log('CLI: received shutdown event, exiting...');
|
|
40
|
+
//wtf.dump();
|
|
41
|
+
process.exit(0);
|
|
42
|
+
}
|
|
43
|
+
async function restart() {
|
|
44
|
+
console.log('CLI: received restart event, loading...');
|
|
45
|
+
//wtf.dump();
|
|
46
|
+
instance = await Matterbridge.loadInstance(true);
|
|
47
|
+
registerHandlers();
|
|
48
|
+
}
|
|
32
49
|
process.title = 'matterbridge';
|
|
33
50
|
main().catch((error) => {
|
|
34
|
-
// eslint-disable-next-line no-console
|
|
35
51
|
console.error(`CLI: Matterbridge.loadInstance() failed with error: ${error}`);
|
|
36
52
|
});
|
|
37
53
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,KAAK,UAAU,IAAI;IACjB,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,+BAA+B;AAC/B,4BAA4B;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,IAAI,QAAkC,CAAC;AAEvC,KAAK,UAAU,IAAI;IACjB,OAAO,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAC;IACvD,QAAQ,GAAG,MAAM,YAAY,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IACjD,gBAAgB,EAAE,CAAC;IACnB,OAAO,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAC;AACzD,CAAC;AAED,SAAS,gBAAgB;IACvB,QAAS,CAAC,EAAE,CAAC,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;IACjD,QAAS,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;AACjD,CAAC;AAED,KAAK,UAAU,QAAQ;IACrB,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAC;IACxD,aAAa;IACb,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,KAAK,UAAU,OAAO;IACpB,OAAO,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAC;IACvD,aAAa;IACb,QAAQ,GAAG,MAAM,YAAY,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IACjD,gBAAgB,EAAE,CAAC;AACrB,CAAC;AAED,OAAO,CAAC,KAAK,GAAG,cAAc,CAAC;AAE/B,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,uDAAuD,KAAK,EAAE,CAAC,CAAC;AAChF,CAAC,CAAC,CAAC"}
|
package/dist/matterbridge.d.ts
CHANGED
|
@@ -20,7 +20,9 @@
|
|
|
20
20
|
* See the License for the specific language governing permissions and
|
|
21
21
|
* limitations under the License. *
|
|
22
22
|
*/
|
|
23
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
23
24
|
import { MatterbridgeDevice } from './matterbridgeDevice.js';
|
|
25
|
+
import EventEmitter from 'events';
|
|
24
26
|
interface SystemInformation {
|
|
25
27
|
ipv4Address: string;
|
|
26
28
|
ipv6Address: string;
|
|
@@ -37,15 +39,26 @@ interface SystemInformation {
|
|
|
37
39
|
/**
|
|
38
40
|
* Represents the Matterbridge application.
|
|
39
41
|
*/
|
|
40
|
-
export declare class Matterbridge {
|
|
42
|
+
export declare class Matterbridge extends EventEmitter {
|
|
41
43
|
systemInformation: SystemInformation;
|
|
44
|
+
matterbridgeInformation: {
|
|
45
|
+
homeDirectory: string;
|
|
46
|
+
rootDirectory: string;
|
|
47
|
+
matterbridgeDirectory: string;
|
|
48
|
+
matterbridgePluginDirectory: string;
|
|
49
|
+
globalModulesDirectory: string;
|
|
50
|
+
matterbridgeVersion: string;
|
|
51
|
+
matterbridgeLatestVersion: string;
|
|
52
|
+
bridgeMode: string;
|
|
53
|
+
debugEnabled: boolean;
|
|
54
|
+
};
|
|
42
55
|
homeDirectory: string;
|
|
43
56
|
rootDirectory: string;
|
|
44
57
|
matterbridgeDirectory: string;
|
|
45
58
|
matterbridgePluginDirectory: string;
|
|
59
|
+
globalModulesDirectory: string;
|
|
46
60
|
matterbridgeVersion: string;
|
|
47
61
|
matterbridgeLatestVersion: string;
|
|
48
|
-
globalModulesDir: string;
|
|
49
62
|
bridgeMode: 'bridge' | 'childbridge' | 'controller' | '';
|
|
50
63
|
debugEnabled: boolean;
|
|
51
64
|
private log;
|
|
@@ -82,6 +95,13 @@ export declare class Matterbridge {
|
|
|
82
95
|
* @returns A Promise that resolves when the initialization is complete.
|
|
83
96
|
*/
|
|
84
97
|
initialize(): Promise<void>;
|
|
98
|
+
/**
|
|
99
|
+
* Spawns a child process with the given command and arguments.
|
|
100
|
+
* @param command - The command to execute.
|
|
101
|
+
* @param args - The arguments to pass to the command (default: []).
|
|
102
|
+
* @returns A promise that resolves when the child process exits successfully, or rejects if there is an error.
|
|
103
|
+
*/
|
|
104
|
+
private spawnCommand;
|
|
85
105
|
/**
|
|
86
106
|
* Parses the command line arguments and performs the corresponding actions.
|
|
87
107
|
* @private
|
|
@@ -131,6 +151,14 @@ export declare class Matterbridge {
|
|
|
131
151
|
* @returns {Promise<void>} - A promise that resolves when the storage process is started.
|
|
132
152
|
*/
|
|
133
153
|
addBridgedDevice(pluginName: string, device: MatterbridgeDevice): Promise<void>;
|
|
154
|
+
removeBridgedDevice(pluginName: string, device: MatterbridgeDevice): Promise<void>;
|
|
155
|
+
/**
|
|
156
|
+
* Removes all bridged devices associated with a specific plugin.
|
|
157
|
+
*
|
|
158
|
+
* @param pluginName - The name of the plugin.
|
|
159
|
+
* @returns A promise that resolves when all devices have been removed.
|
|
160
|
+
*/
|
|
161
|
+
removeAllBridgedDevices(pluginName: string): Promise<void>;
|
|
134
162
|
/**
|
|
135
163
|
* Starts the storage process based on the specified storage type and name.
|
|
136
164
|
* @param {string} storageType - The type of storage to start (e.g., 'disk', 'json').
|
|
@@ -241,6 +269,11 @@ export declare class Matterbridge {
|
|
|
241
269
|
* @returns A Promise that resolves to the latest version of the package.
|
|
242
270
|
*/
|
|
243
271
|
private getLatestVersion;
|
|
272
|
+
/**
|
|
273
|
+
* Retrieves the path to the global Node.js modules directory.
|
|
274
|
+
* @returns A promise that resolves to the path of the global Node.js modules directory.
|
|
275
|
+
*/
|
|
276
|
+
private getGlobalNodeModules;
|
|
244
277
|
/**
|
|
245
278
|
* Logs the node and system information.
|
|
246
279
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matterbridge.d.ts","sourceRoot":"","sources":["../src/matterbridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG
|
|
1
|
+
{"version":3,"file":"matterbridge.d.ts","sourceRoot":"","sources":["../src/matterbridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;AAEH,OAAO,EAAE,kBAAkB,EAAgC,MAAM,yBAAyB,CAAC;AAQ3F,OAAO,YAAY,MAAM,QAAQ,CAAC;AAkElC,UAAU,iBAAiB;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB;AAMD;;GAEG;AACH,qBAAa,YAAa,SAAQ,YAAY;IACrC,iBAAiB,EAAE,iBAAiB,CAYzC;IAEK,uBAAuB;;;;;;;;;;MAU5B;IAEK,aAAa,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