matterbridge 1.1.4 → 1.1.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/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.1.5] - 2024-03-11
6
+
7
+ ### Added
8
+
9
+ - [debug]: Added public property enableDebug to Matterbridge.
10
+ - [debug]: Added parameter -debug to the command line.
11
+
12
+ ### Fixed
13
+
14
+ - [plugin]: Fixed the plugin.paired and plugin.commissioned in bridge mode.
15
+ - [routes]: Fixed the plugin devices route.
16
+ - [bridge]: Fixed the BasicInformationCluster in bridge mode.
17
+
5
18
  ## [1.1.4] - 2024-03-10
6
19
 
7
20
  ### Changed
package/README.md CHANGED
@@ -1,11 +1,9 @@
1
- # Matterbridge
1
+ # <img src="https://github.com/Luligu/matterbridge/blob/main/frontend/public/matterbridge%2064x64.png" alt="Matterbridge Logo" width="64px" height="64px">&nbsp;&nbsp;&nbsp;Matterbridge
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/matterbridge.svg)](https://www.npmjs.com/package/matterbridge)
4
4
  [![npm downloads](https://img.shields.io/npm/dt/matterbridge.svg)](https://www.npmjs.com/package/matterbridge)
5
5
 
6
-
7
6
  [![power by](https://img.shields.io/badge/powered%20by-node--ansi--logger-blue)](https://www.npmjs.com/package/node-ansi-logger)
8
-
9
7
  [![power by](https://img.shields.io/badge/powered%20by-node--persist--manager-blue)](https://www.npmjs.com/package/node-persist-manager)
10
8
 
11
9
  ---
@@ -27,16 +25,19 @@ any other ecosystem supporting Matter.
27
25
 
28
26
  The project is build on top of https://github.com/project-chip/matter.js.
29
27
 
30
- A special thank to Apollon77 for is incredible work.
28
+ A special thank to Apollon77 for his incredible work.
31
29
 
32
30
  ## Installation
33
31
 
34
32
  Follow these steps to install Matterbridge:
35
- ```
33
+
34
+ on Windows:
35
+ ``` powershell
36
36
  npm install -g matterbridge
37
37
  ```
38
- or
39
- ```
38
+
39
+ on Linux (you need the necessary permissions):
40
+ ``` bash
40
41
  sudo npm install -g matterbridge
41
42
  ```
42
43
 
@@ -73,7 +74,7 @@ matterbridge -help
73
74
 
74
75
  ## Frontend
75
76
 
76
- Matterbridge has a frontend (currently under development) available http://localhost:3000
77
+ Matterbridge has a frontend available on http://localhost:3000
77
78
 
78
79
  You can change the default port by adding the frontend parameter when you launch it.
79
80
  Here's how to specify a different port number:
@@ -125,12 +126,13 @@ Matterbridge can run as many plugins as you want.
125
126
  ## How to install a plugin
126
127
 
127
128
  To install i.e. https://github.com/Luligu/matterbridge-example-accessory-platform
129
+
128
130
  ```
129
131
  git clone https://github.com/Luligu/matterbridge-example-accessory-platform
130
132
  cd matterbridge-example-accessory-platform
131
133
  npm install
132
- npm run build
133
134
  ```
135
+
134
136
  Then add the plugin to Matterbridge
135
137
  ```
136
138
  matterbridge -add .\
@@ -42,7 +42,9 @@ export declare class Matterbridge {
42
42
  homeDirectory: string;
43
43
  rootDirectory: string;
44
44
  matterbridgeDirectory: string;
45
+ matterbridgeVersion: string;
45
46
  bridgeMode: 'bridge' | 'childbridge' | 'controller' | '';
47
+ debugEnabled: boolean;
46
48
  private log;
47
49
  private hasCleanupStarted;
48
50
  private registeredPlugins;
@@ -61,7 +63,7 @@ export declare class Matterbridge {
61
63
  private constructor();
62
64
  /**
63
65
  * Loads an instance of the Matterbridge class.
64
- * If an instance already exists, an error will be thrown.
66
+ * If an instance already exists, return that instance.
65
67
  * @returns The loaded instance of the Matterbridge class.
66
68
  */
67
69
  static loadInstance(cli?: boolean): Promise<Matterbridge>;
@@ -85,10 +87,10 @@ export declare class Matterbridge {
85
87
  /**
86
88
  * Loads a plugin from the specified package.json file path.
87
89
  * @param packageJsonPath - The path to the package.json file of the plugin.
88
- * @param mode - The mode of operation. Possible values are 'load', 'add', 'remove', 'enable', 'disable'.
90
+ * @param mode - The mode of operation. Possible values are 'add', 'remove', 'enable', 'disable'.
89
91
  * @returns A Promise that resolves when the plugin is loaded successfully, or rejects with an error if loading fails.
90
92
  */
91
- private loadPlugin;
93
+ private executeCommandLine;
92
94
  /**
93
95
  * Registers the signal handlers for SIGINT and SIGTERM.
94
96
  * When either of these signals are received, the cleanup method is called with an appropriate message.
@@ -110,12 +112,14 @@ export declare class Matterbridge {
110
112
  * Adds a device to the Matterbridge.
111
113
  * @param pluginName - The name of the plugin.
112
114
  * @param device - The device to be added.
115
+ * @returns A Promise that resolves when the device is added successfully.
113
116
  */
114
117
  addDevice(pluginName: string, device: MatterbridgeDevice): Promise<void>;
115
118
  /**
116
119
  * Adds a bridged device to the Matterbridge.
117
120
  * @param pluginName - The name of the plugin.
118
121
  * @param device - The bridged device to add.
122
+ * @returns {Promise<void>} - A promise that resolves when the storage process is started.
119
123
  */
120
124
  addBridgedDevice(pluginName: string, device: MatterbridgeDevice): Promise<void>;
121
125
  /**
@@ -137,6 +141,10 @@ export declare class Matterbridge {
137
141
  * @returns {Promise<void>} A promise that resolves when the storage is stopped.
138
142
  */
139
143
  private stopStorage;
144
+ private testStartMatterBridge;
145
+ private startPlugin;
146
+ private configurePlugin;
147
+ private loadPlugin;
140
148
  /**
141
149
  * Starts the Matterbridge based on the bridge mode.
142
150
  * If the bridge mode is 'bridge', it creates a commissioning server, matter aggregator,
@@ -222,7 +230,8 @@ export declare class Matterbridge {
222
230
  * Logs the node and system information.
223
231
  */
224
232
  private logNodeAndSystemInfo;
225
- private getBaseRegisteredPlugin;
233
+ private getBaseRegisteredPlugins;
234
+ private getBaseRegisteredDevices;
226
235
  /**
227
236
  * Initializes the frontend of Matterbridge.
228
237
  *
@@ -1 +1 @@
1
- {"version":3,"file":"matterbridge.d.ts","sourceRoot":"","sources":["../src/matterbridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAsE7D,UAAU,iBAAiB;IACzB,WAAW,EAAE,MAAM,CA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