matterbridge 1.1.11 → 1.2.0
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 +18 -3
- package/README.md +59 -14
- package/dist/AirQualityCluster.d.ts.map +1 -1
- package/dist/AirQualityCluster.js +1 -10
- package/dist/AirQualityCluster.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/matterbridge.d.ts +90 -14
- package/dist/matterbridge.d.ts.map +1 -1
- package/dist/matterbridge.js +249 -90
- package/dist/matterbridge.js.map +1 -1
- package/dist/matterbridgeAccessoryPlatform.d.ts +5 -7
- package/dist/matterbridgeAccessoryPlatform.d.ts.map +1 -1
- package/dist/matterbridgeAccessoryPlatform.js +6 -8
- package/dist/matterbridgeAccessoryPlatform.js.map +1 -1
- package/dist/matterbridgeDevice.d.ts +66 -1
- package/dist/matterbridgeDevice.d.ts.map +1 -1
- package/dist/matterbridgeDevice.js +128 -10
- package/dist/matterbridgeDevice.js.map +1 -1
- package/dist/matterbridgeDynamicPlatform.d.ts +5 -7
- package/dist/matterbridgeDynamicPlatform.d.ts.map +1 -1
- package/dist/matterbridgeDynamicPlatform.js +6 -8
- package/dist/matterbridgeDynamicPlatform.js.map +1 -1
- package/dist/matterbridgePlatform.d.ts +43 -0
- package/dist/matterbridgePlatform.d.ts.map +1 -0
- package/dist/matterbridgePlatform.js +45 -0
- package/dist/matterbridgePlatform.js.map +1 -0
- package/frontend/build/asset-manifest.json +6 -6
- package/frontend/build/index.html +1 -1
- package/frontend/build/static/css/{main.70102d98.css → main.b996bc4e.css} +2 -2
- package/frontend/build/static/css/main.b996bc4e.css.map +1 -0
- package/frontend/build/static/js/{main.5d39b100.js → main.657bca15.js} +3 -3
- package/frontend/build/static/js/main.657bca15.js.map +1 -0
- package/package.json +12 -10
- package/dist/ColorControlServer.d.ts +0 -86
- package/dist/ColorControlServer.d.ts.map +0 -1
- package/dist/ColorControlServer.js +0 -102
- package/dist/ColorControlServer.js.map +0 -1
- package/frontend/build/static/css/main.70102d98.css.map +0 -1
- package/frontend/build/static/js/main.5d39b100.js.map +0 -1
- /package/frontend/build/static/js/{main.5d39b100.js.LICENSE.txt → main.657bca15.js.LICENSE.txt} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,13 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
-
## [1.
|
|
5
|
+
## [1.2.0] - 2024-03-23
|
|
6
|
+
|
|
7
|
+
### Breaking change on plugin default entry point and platform constructor!
|
|
8
|
+
- [plugin default entry point]: export default function initializePlugin(matterbridge: Matterbridge, log: AnsiLogger, config: PlatformConfig)
|
|
9
|
+
- [platform constructor]: constructor(matterbridge: Matterbridge, log: AnsiLogger, config: PlatformConfig)
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- [platform]: Added async loadPluginConfig() and async savePluginConfig() to store plugin config.
|
|
14
|
+
- [platform]: Added: config: PlatformConfig (JSON) property to platforms to store plugin config.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- [dependencies]: Updated dependencies.
|
|
19
|
+
|
|
20
|
+
## [1.1.11] - 2024-03-19
|
|
6
21
|
|
|
7
22
|
### Added
|
|
8
23
|
|
|
9
24
|
- [frontend]: Frontend got updated to 0.8.3.
|
|
10
25
|
|
|
11
|
-
## [1.1.10] - 2024-03-
|
|
26
|
+
## [1.1.10] - 2024-03-17
|
|
12
27
|
|
|
13
28
|
### Added
|
|
14
29
|
|
|
@@ -17,7 +32,7 @@ All notable changes to this project will be documented in this file.
|
|
|
17
32
|
- [frontend]: Enable and disable plugin are now available. Restart Matteerbridge after.
|
|
18
33
|
- [frontend]: Frontend got updated to 0.8.2.
|
|
19
34
|
|
|
20
|
-
## [1.1.9] - 2024-03-
|
|
35
|
+
## [1.1.9] - 2024-03-16
|
|
21
36
|
|
|
22
37
|
### Added
|
|
23
38
|
|
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
---
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
Matterbridge is a
|
|
13
|
+
Matterbridge is a matter.js plugin manager.
|
|
14
14
|
|
|
15
15
|
It allows you to have all your Matter devices up and running in a couple of minutes without
|
|
16
16
|
having to deal with the pairing process of each single device.
|
|
@@ -96,9 +96,11 @@ Devices page:
|
|
|
96
96
|
|
|
97
97
|
### Accessory platform example
|
|
98
98
|
|
|
99
|
-
This an example of an accessory platform plugin.
|
|
99
|
+
This an example of an accessory platform plugin.
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
It exposes a cover device that continuously moves position and shows how to use the command handlers (you can control the device).
|
|
102
|
+
|
|
103
|
+
An Accessory platform plugin only exposes one device.
|
|
102
104
|
|
|
103
105
|
[See the plugin homepage here](https://github.com/Luligu/matterbridge-example-accessory-platform)
|
|
104
106
|
|
|
@@ -106,7 +108,11 @@ Accessory platform plugins only expose one device.
|
|
|
106
108
|
|
|
107
109
|
This an example of a dynamic platform plugin.
|
|
108
110
|
|
|
109
|
-
|
|
111
|
+
It exposes a switch with onOff, a light with onOff-levelControl-colorControl, an outlet with onOff and a cover device.
|
|
112
|
+
|
|
113
|
+
All these devices continuously change state and position. The plugin also shows how to use all the command handlers (you can control all the devices).
|
|
114
|
+
|
|
115
|
+
A Dynamic platform plugin exposes as many devices as you need (the limit for the Home app is 150 accessories for bridge).
|
|
110
116
|
|
|
111
117
|
Matterbridge can run as many plugins as you want.
|
|
112
118
|
|
|
@@ -124,10 +130,40 @@ Matterbridge can run as many plugins as you want.
|
|
|
124
130
|
|
|
125
131
|
[Room plugin with history](https://github.com/Luligu/matterbridge-eve-room)
|
|
126
132
|
|
|
127
|
-
## How to install a plugin
|
|
133
|
+
## How to install and register a production-level plugin (from npm)
|
|
134
|
+
|
|
135
|
+
To install i.e. https://github.com/Luligu/matterbridge-zigbee2mqtt
|
|
136
|
+
|
|
137
|
+
On windows:
|
|
138
|
+
```
|
|
139
|
+
cd $HOME\Matterbridge
|
|
140
|
+
npm install -g matterbridge-zigbee2mqtt
|
|
141
|
+
matterbridge -add matterbridge-zigbee2mqtt
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
On linux:
|
|
145
|
+
```
|
|
146
|
+
cd ~/Matterbridge
|
|
147
|
+
sudo npm install -g matterbridge-zigbee2mqtt
|
|
148
|
+
matterbridge -add matterbridge-zigbee2mqtt
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## How to install and register a plugin for development (from git)
|
|
128
152
|
|
|
129
153
|
To install i.e. https://github.com/Luligu/matterbridge-example-accessory-platform
|
|
130
154
|
|
|
155
|
+
On windows:
|
|
156
|
+
```
|
|
157
|
+
cd $HOME\Matterbridge
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
On linux:
|
|
161
|
+
```
|
|
162
|
+
cd ~/Matterbridge
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
then
|
|
166
|
+
|
|
131
167
|
```
|
|
132
168
|
git clone https://github.com/Luligu/matterbridge-example-accessory-platform
|
|
133
169
|
cd matterbridge-example-accessory-platform
|
|
@@ -139,28 +175,28 @@ Then add the plugin to Matterbridge
|
|
|
139
175
|
matterbridge -add .\
|
|
140
176
|
```
|
|
141
177
|
|
|
142
|
-
|
|
178
|
+
## How to add a plugin to Matterbridge
|
|
143
179
|
|
|
144
180
|
```
|
|
145
|
-
matterbridge -add
|
|
181
|
+
matterbridge -add [plugin path]
|
|
146
182
|
```
|
|
147
183
|
|
|
148
|
-
|
|
184
|
+
## How to remove a plugin from Matterbridge
|
|
149
185
|
|
|
150
186
|
```
|
|
151
|
-
matterbridge -remove
|
|
187
|
+
matterbridge -remove [plugin path]
|
|
152
188
|
```
|
|
153
189
|
|
|
154
|
-
|
|
190
|
+
## How to disable a registered plugin
|
|
155
191
|
|
|
156
192
|
```
|
|
157
|
-
matterbridge -disable
|
|
193
|
+
matterbridge -disable [plugin path]
|
|
158
194
|
```
|
|
159
195
|
|
|
160
|
-
|
|
196
|
+
## How to enable a registered plugin
|
|
161
197
|
|
|
162
198
|
```
|
|
163
|
-
matterbridge -enable
|
|
199
|
+
matterbridge -enable [plugin path]
|
|
164
200
|
```
|
|
165
201
|
|
|
166
202
|
## How to create your plugin
|
|
@@ -178,6 +214,15 @@ Add your plugin logic in platform.ts.
|
|
|
178
214
|
|
|
179
215
|
## MatterbridgeDynamicPlatform and MatterbridgeAccessoryPlatform api
|
|
180
216
|
|
|
217
|
+
### name: string
|
|
218
|
+
The plugin name.
|
|
219
|
+
|
|
220
|
+
### type: string
|
|
221
|
+
The plugin platform type.
|
|
222
|
+
|
|
223
|
+
### config: object
|
|
224
|
+
The plugin config (loaded before onStart() is called and saved after onShutdown() is called).
|
|
225
|
+
|
|
181
226
|
### async onStart(reason?: string)
|
|
182
227
|
The method onStart() is where you have to create your MatterbridgeDevice and add all needed clusters and command handlers.
|
|
183
228
|
|
|
@@ -204,7 +249,7 @@ You can unregister one or more device.
|
|
|
204
249
|
### async unregisterAllDevices()
|
|
205
250
|
You can unregister all devices you added.
|
|
206
251
|
|
|
207
|
-
It can
|
|
252
|
+
It can be useful to call this method from onShutdown() if you don't want to keep all the devices during development.
|
|
208
253
|
|
|
209
254
|
## MatterbridgeDevice api
|
|
210
255
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AirQualityCluster.d.ts","sourceRoot":"","sources":["../src/AirQualityCluster.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAGlG,yBAAiB,UAAU,CAAC;IAC1B,KAAY,OA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B,mCAA+B,CAAC;IACjE,MAAM,gCAAgC,mCAA+B,CAAC;IAEtE,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAenB,CAAC;IAEF,KAAY,SAAS,CAAC,EAAE,SAAS,wBAAwB,CAAC,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,OAAO,IAAI,EAAE,mBAAmB,CAAC,GAAG;QAAE,iBAAiB,EAAE,EAAE,CAAA;KAAE,GAAG,CAAC,EAAE,SAAS;QAChK,cAAc,EAAE,IAAI,CAAC;KACtB,GACG,OAAO,uBAAuB,GAC9B,EAAE,CAAC,GACP,CAAC,EAAE,SAAS;QAAE,kBAAkB,EAAE,IAAI,CAAA;KAAE,GAAG,OAAO,2BAA2B,GAAG,EAAE,CAAC,GACnF,CAAC,EAAE,SAAS;QAAE,kBAAkB,EAAE,IAAI,CAAA;KAAE,GAAG,OAAO,2BAA2B,GAAG,EAAE,CAAC,GACnF,CAAC,EAAE,SAAS;QAAE,uBAAuB,EAAE,IAAI,CAAA;KAAE,GAAG,OAAO,gCAAgC,GAAG,EAAE,CAAC,CAAC;CACjG;AAED,MAAM,MAAM,iBAAiB,GAAG,OAAO,UAAU,CAAC,OAAO,CAAC;AAC1D,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAqB,CAAC"}
|
|
@@ -63,16 +63,7 @@ export var AirQuality;
|
|
|
63
63
|
AirQuality.ModerateAirQualityComponent = ClusterFactory.Component({});
|
|
64
64
|
AirQuality.VeryPoorAirQualityComponent = ClusterFactory.Component({});
|
|
65
65
|
AirQuality.ExtremelyPoorAirQualityComponent = ClusterFactory.Component({});
|
|
66
|
-
AirQuality.Cluster = ClusterFactory.Extensible(AirQuality.Base,
|
|
67
|
-
/**
|
|
68
|
-
* Use this factory method to create a Switch cluster with support for optional features. Include each
|
|
69
|
-
* {@link Feature} you wish to support.
|
|
70
|
-
*
|
|
71
|
-
* @param features the optional features to support
|
|
72
|
-
* @returns a Switch cluster with specified features enabled
|
|
73
|
-
* @throws {IllegalClusterError} if the feature combination is disallowed by the Matter specification
|
|
74
|
-
*/
|
|
75
|
-
(...features) => {
|
|
66
|
+
AirQuality.Cluster = ClusterFactory.Extensible(AirQuality.Base, (...features) => {
|
|
76
67
|
ClusterFactory.validateFeatureSelection(features, Feature);
|
|
77
68
|
const cluster = ClusterFactory.Definition({
|
|
78
69
|
...AirQuality.Base,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AirQualityCluster.js","sourceRoot":"","sources":["../src/AirQualityCluster.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,oDAAoD;AACpD,iDAAiD;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAA4B,MAAM,qCAAqC,CAAC;AAClG,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAE3D,MAAM,KAAW,UAAU,
|
|
1
|
+
{"version":3,"file":"AirQualityCluster.js","sourceRoot":"","sources":["../src/AirQualityCluster.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,oDAAoD;AACpD,iDAAiD;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAA4B,MAAM,qCAAqC,CAAC;AAClG,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAE3D,MAAM,KAAW,UAAU,CAiE1B;AAjED,WAAiB,UAAU;IACzB,IAAY,OAKX;IALD,WAAY,OAAO;QACjB,4CAAiC,CAAA;QACjC,oDAAyC,CAAA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P,iBAAiB,EAAE,QAAQ,CAAC,WAAA,IAAI,CAAC,QAAQ,EAAE,GAAG,QAAQ,CAAC;SACxD,CAAC,CAAC;QACH,cAAc,CAAC,MAAM,CAAC,OAAO,EAAE,WAAA,uBAAuB,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC;QAClF,cAAc,CAAC,MAAM,CAAC,OAAO,EAAE,WAAA,2BAA2B,EAAE,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1F,cAAc,CAAC,MAAM,CAAC,OAAO,EAAE,WAAA,2BAA2B,EAAE,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1F,cAAc,CAAC,MAAM,CAAC,OAAO,EAAE,WAAA,gCAAgC,EAAE,EAAE,uBAAuB,EAAE,IAAI,EAAE,CAAC,CAAC;QACpG,OAAO,OAAkE,CAAC;IAC5E,CAAC,CACF,CAAC;AAUJ,CAAC,EAjEgB,UAAU,KAAV,UAAU,QAiE1B;AAGD,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -31,6 +31,5 @@ export * from './matterbridgeDevice.js';
|
|
|
31
31
|
export * from './matterbridgeAccessoryPlatform.js';
|
|
32
32
|
export * from './matterbridgeDynamicPlatform.js';
|
|
33
33
|
export * from './AirQualityCluster.js';
|
|
34
|
-
export * from './ColorControlServer.js';
|
|
35
34
|
export * from './TvocCluster.js';
|
|
36
35
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,8BAA8B,CAAC;AAGtC,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC;AAEtD,cAAc,gBAAgB,CAAC;AAE/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,wBAAwB,CAAC;AACvC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,8BAA8B,CAAC;AAGtC,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC;AAEtD,cAAc,gBAAgB,CAAC;AAE/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -32,7 +32,6 @@ export * from './matterbridgeDevice.js';
|
|
|
32
32
|
export * from './matterbridgeAccessoryPlatform.js';
|
|
33
33
|
export * from './matterbridgeDynamicPlatform.js';
|
|
34
34
|
export * from './AirQualityCluster.js';
|
|
35
|
-
export * from './ColorControlServer.js';
|
|
36
35
|
export * from './TvocCluster.js';
|
|
37
36
|
async function main() {
|
|
38
37
|
// eslint-disable-next-line no-console
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC;AAEtD,cAAc,gBAAgB,CAAC;AAE/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,wBAAwB,CAAC;AACvC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC;AAEtD,cAAc,gBAAgB,CAAC;AAE/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AAEjC,KAAK,UAAU,IAAI;IACjB,sCAAsC;IACtC,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAC;IACxD,MAAM,YAAY,CAAC,YAAY,EAAE,CAAC;IAClC,sCAAsC;IACtC,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAC;AAC1D,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,sCAAsC;IACtC,OAAO,CAAC,KAAK,CAAC,wDAAwD,KAAK,EAAE,CAAC,CAAC;AACjF,CAAC,CAAC,CAAC"}
|
package/dist/matterbridge.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @file matterbridge.ts
|
|
5
5
|
* @author Luca Liguori
|
|
6
6
|
* @date 2023-12-29
|
|
7
|
-
* @version 1.
|
|
7
|
+
* @version 1.2.0
|
|
8
8
|
*
|
|
9
9
|
* Copyright 2023, 2024 Luca Liguori.
|
|
10
10
|
*
|
|
@@ -23,6 +23,10 @@
|
|
|
23
23
|
/// <reference types="node" resolution-mode="require"/>
|
|
24
24
|
import { MatterbridgeDevice } from './matterbridgeDevice.js';
|
|
25
25
|
import EventEmitter from 'events';
|
|
26
|
+
export type PlatformConfigValue = string | number | boolean | bigint | object | undefined | null;
|
|
27
|
+
export type PlatformConfig = {
|
|
28
|
+
[key: string]: PlatformConfigValue;
|
|
29
|
+
};
|
|
26
30
|
interface SystemInformation {
|
|
27
31
|
ipv4Address: string;
|
|
28
32
|
ipv6Address: string;
|
|
@@ -81,7 +85,9 @@ export declare class Matterbridge extends EventEmitter {
|
|
|
81
85
|
/**
|
|
82
86
|
* Loads an instance of the Matterbridge class.
|
|
83
87
|
* If an instance already exists, return that instance.
|
|
84
|
-
*
|
|
88
|
+
*
|
|
89
|
+
* @param initialize - Whether to initialize the Matterbridge instance after loading.
|
|
90
|
+
* @returns The loaded Matterbridge instance.
|
|
85
91
|
*/
|
|
86
92
|
static loadInstance(initialize?: boolean): Promise<Matterbridge>;
|
|
87
93
|
/**
|
|
@@ -108,6 +114,11 @@ export declare class Matterbridge extends EventEmitter {
|
|
|
108
114
|
* @returns {Promise<void>} A promise that resolves when the command line arguments have been processed.
|
|
109
115
|
*/
|
|
110
116
|
private parseCommandLine;
|
|
117
|
+
/**
|
|
118
|
+
* Resolves the name of a plugin by loading and parsing its package.json file.
|
|
119
|
+
* @param pluginPath - The path to the plugin or the path to the plugin's package.json file.
|
|
120
|
+
* @returns The path to the resolved package.json file, or null if the package.json file is not found or does not contain a name.
|
|
121
|
+
*/
|
|
111
122
|
private resolvePluginName;
|
|
112
123
|
/**
|
|
113
124
|
* Loads a plugin from the specified package.json file path.
|
|
@@ -126,8 +137,10 @@ export declare class Matterbridge extends EventEmitter {
|
|
|
126
137
|
*/
|
|
127
138
|
private restartProcess;
|
|
128
139
|
/**
|
|
129
|
-
*
|
|
130
|
-
* @param message - The
|
|
140
|
+
* Cleans up the Matterbridge instance.
|
|
141
|
+
* @param message - The cleanup message.
|
|
142
|
+
* @param restart - Indicates whether to restart the instance after cleanup. Default is `false`.
|
|
143
|
+
* @returns A promise that resolves when the cleanup is completed.
|
|
131
144
|
*/
|
|
132
145
|
private cleanup;
|
|
133
146
|
/**
|
|
@@ -151,6 +164,12 @@ export declare class Matterbridge extends EventEmitter {
|
|
|
151
164
|
* @returns {Promise<void>} - A promise that resolves when the storage process is started.
|
|
152
165
|
*/
|
|
153
166
|
addBridgedDevice(pluginName: string, device: MatterbridgeDevice): Promise<void>;
|
|
167
|
+
/**
|
|
168
|
+
* Removes a bridged device from the Matterbridge.
|
|
169
|
+
* @param pluginName - The name of the plugin.
|
|
170
|
+
* @param device - The device to be removed.
|
|
171
|
+
* @returns A Promise that resolves when the device is successfully removed.
|
|
172
|
+
*/
|
|
154
173
|
removeBridgedDevice(pluginName: string, device: MatterbridgeDevice): Promise<void>;
|
|
155
174
|
/**
|
|
156
175
|
* Removes all bridged devices associated with a specific plugin.
|
|
@@ -179,8 +198,55 @@ export declare class Matterbridge extends EventEmitter {
|
|
|
179
198
|
*/
|
|
180
199
|
private stopStorage;
|
|
181
200
|
private testStartMatterBridge;
|
|
201
|
+
/**
|
|
202
|
+
* Loads the configuration for a plugin.
|
|
203
|
+
* If the configuration file exists, it reads the file and returns the parsed JSON data.
|
|
204
|
+
* If the configuration file does not exist, it creates a new file with default configuration and returns it.
|
|
205
|
+
* If any error occurs during file access or creation, it logs an error and rejects the promise with the error.
|
|
206
|
+
*
|
|
207
|
+
* @param plugin - The plugin for which to load the configuration.
|
|
208
|
+
* @returns A promise that resolves to the loaded or created configuration.
|
|
209
|
+
*/
|
|
210
|
+
private loadPluginConfig;
|
|
211
|
+
/**
|
|
212
|
+
* Saves the configuration of a registered plugin.
|
|
213
|
+
* @param {RegisteredPlugin} plugin - The plugin whose configuration needs to be saved.
|
|
214
|
+
* @returns {Promise<void>} - A promise that resolves when the configuration is successfully saved.
|
|
215
|
+
* @throws {Error} - If the plugin's configuration is not found or if there is an error while saving the configuration.
|
|
216
|
+
*/
|
|
217
|
+
private savePluginConfig;
|
|
218
|
+
/**
|
|
219
|
+
* Writes data to a file.
|
|
220
|
+
*
|
|
221
|
+
* @param {string} filePath - The path of the file to write to.
|
|
222
|
+
* @param {string} data - The data to write to the file.
|
|
223
|
+
* @returns {Promise<void>} - A promise that resolves when the data is successfully written to the file.
|
|
224
|
+
*/
|
|
225
|
+
private writeFile;
|
|
226
|
+
/**
|
|
227
|
+
* Starts a plugin.
|
|
228
|
+
*
|
|
229
|
+
* @param {RegisteredPlugin} plugin - The plugin to start.
|
|
230
|
+
* @param {string} [message] - Optional message to pass to the plugin's onStart method.
|
|
231
|
+
* @param {boolean} [configure=false] - Indicates whether to configure the plugin after starting.
|
|
232
|
+
* @returns {Promise<void>} A promise that resolves when the plugin is started successfully, or rejects with an error if starting the plugin fails.
|
|
233
|
+
*/
|
|
182
234
|
private startPlugin;
|
|
235
|
+
/**
|
|
236
|
+
* Configures a plugin.
|
|
237
|
+
*
|
|
238
|
+
* @param {RegisteredPlugin} plugin - The plugin to configure.
|
|
239
|
+
* @returns {Promise<void>} A promise that resolves when the plugin is configured successfully, or rejects with an error if configuration fails.
|
|
240
|
+
*/
|
|
183
241
|
private configurePlugin;
|
|
242
|
+
/**
|
|
243
|
+
* Loads a plugin and returns the corresponding MatterbridgePlatform instance.
|
|
244
|
+
* @param plugin - The plugin to load.
|
|
245
|
+
* @param start - Optional flag indicating whether to start the plugin after loading. Default is false.
|
|
246
|
+
* @param message - Optional message to pass to the plugin when starting.
|
|
247
|
+
* @returns A Promise that resolves to the loaded MatterbridgePlatform instance.
|
|
248
|
+
* @throws An error if the plugin is not enabled, already loaded, or fails to load.
|
|
249
|
+
*/
|
|
184
250
|
private loadPlugin;
|
|
185
251
|
/**
|
|
186
252
|
* Starts the Matterbridge based on the bridge mode.
|
|
@@ -192,6 +258,10 @@ export declare class Matterbridge extends EventEmitter {
|
|
|
192
258
|
* @returns {Promise<void>} A promise that resolves when the Matterbridge is started.
|
|
193
259
|
*/
|
|
194
260
|
private startMatterBridge;
|
|
261
|
+
/**
|
|
262
|
+
* Starts the Matter server.
|
|
263
|
+
* If the Matter server is not initialized, it logs an error and performs cleanup.
|
|
264
|
+
*/
|
|
195
265
|
private startMatterServer;
|
|
196
266
|
/**
|
|
197
267
|
* Imports the commissioning server context for a specific plugin and device.
|
|
@@ -221,15 +291,12 @@ export declare class Matterbridge extends EventEmitter {
|
|
|
221
291
|
*/
|
|
222
292
|
private createCommissioningServerContext;
|
|
223
293
|
/**
|
|
224
|
-
* Shows the commissioning QR code for a given
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
* @param commissioningServer - The commissioning server to show the QR code for.
|
|
231
|
-
* @param storageContext - The storage context to store the pairing codes.
|
|
232
|
-
* @param pluginName - The name of the commissioning server.
|
|
294
|
+
* Shows the commissioning QR code for a given plugin.
|
|
295
|
+
* @param {CommissioningServer} commissioningServer - The commissioning server instance.
|
|
296
|
+
* @param {StorageContext} storageContext - The storage context instance.
|
|
297
|
+
* @param {NodeStorage} nodeContext - The node storage instance.
|
|
298
|
+
* @param {string} pluginName - The name of the plugin.
|
|
299
|
+
* @returns {Promise<void>} - A promise that resolves when the QR code is shown.
|
|
233
300
|
*/
|
|
234
301
|
private showCommissioningQRCode;
|
|
235
302
|
/**
|
|
@@ -243,7 +310,7 @@ export declare class Matterbridge extends EventEmitter {
|
|
|
243
310
|
* Creates a matter commissioning server.
|
|
244
311
|
*
|
|
245
312
|
* @param {StorageContext} context - The storage context.
|
|
246
|
-
* @param {string}
|
|
313
|
+
* @param {string} pluginName - The name of the commissioning server.
|
|
247
314
|
* @returns {CommissioningServer} The created commissioning server.
|
|
248
315
|
*/
|
|
249
316
|
private createCommisioningServer;
|
|
@@ -278,7 +345,16 @@ export declare class Matterbridge extends EventEmitter {
|
|
|
278
345
|
* Logs the node and system information.
|
|
279
346
|
*/
|
|
280
347
|
private logNodeAndSystemInfo;
|
|
348
|
+
/**
|
|
349
|
+
* Retrieves an array of base registered plugins.
|
|
350
|
+
*
|
|
351
|
+
* @returns {BaseRegisteredPlugin[]} An array of base registered plugins.
|
|
352
|
+
*/
|
|
281
353
|
private getBaseRegisteredPlugins;
|
|
354
|
+
/**
|
|
355
|
+
* Retrieves an array of base registered devices from the registered plugins.
|
|
356
|
+
* @returns {BaseRegisteredPlugin[]} An array of base registered devices.
|
|
357
|
+
*/
|
|
282
358
|
private getBaseRegisteredDevices;
|
|
283
359
|
/**
|
|
284
360
|
* Initializes the frontend of Matterbridge.
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AA4BlC,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;AAEjG,MAAM,MAAM,cAAc,GAAG;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAAC;CACpC,CAAC;AAuCF,UAAU,iBAAiB;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,M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