matterbridge 1.5.1 → 1.5.2
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-ADVANCED.md → README-DOCKER.md} +1 -82
- package/README-SERVICE.md +96 -0
- package/README.md +54 -17
- package/dist/matterbridge.d.ts +2 -2
- package/dist/matterbridge.d.ts.map +1 -1
- package/dist/matterbridge.js +28 -13
- package/dist/matterbridge.js.map +1 -1
- package/dist/matterbridgeTypes.d.ts +2 -0
- package/dist/matterbridgeTypes.d.ts.map +1 -1
- package/dist/pluginManager.d.ts.map +1 -1
- package/dist/pluginManager.js +16 -0
- package/dist/pluginManager.js.map +1 -1
- package/dist/utils/utils.d.ts +0 -5
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +5 -12
- package/dist/utils/utils.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.1cf003ae.css +2 -0
- package/frontend/build/static/css/main.1cf003ae.css.map +1 -0
- package/frontend/build/static/js/main.cfcfbb06.js +3 -0
- package/frontend/build/static/js/main.cfcfbb06.js.map +1 -0
- package/package.json +7 -8
- package/frontend/build/static/css/main.ee3183e2.css +0 -2
- package/frontend/build/static/css/main.ee3183e2.css.map +0 -1
- package/frontend/build/static/js/main.4c5271fd.js +0 -3
- package/frontend/build/static/js/main.4c5271fd.js.map +0 -1
- /package/frontend/build/static/js/{main.4c5271fd.js.LICENSE.txt → main.cfcfbb06.js.LICENSE.txt} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -16,6 +16,23 @@ If you like this project and find it useful, please consider giving it a star on
|
|
|
16
16
|
|
|
17
17
|
- please read this [Development guide lines](https://github.com/Luligu/matterbridge/blob/main/README-DEV.md)
|
|
18
18
|
|
|
19
|
+
## [1.5.2] - 2024-08-30
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- [frontend]: Added a confirmation message for removing and disabling plugins.
|
|
24
|
+
- [matterbridge cli]: Added the parameter `-sudo` to force the use of sudo when installing or updating a package (this is useful when the internal logic is not working in your setup).
|
|
25
|
+
- [matterbridge cli]: Added the parameter `-nosudo` to force not using sudo when installing or updating a package (this is useful when the internal logic is not working in your setup).
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- [package]: Update dependencies.
|
|
30
|
+
- [spawn]: Modified the install or update function to add more info in the log.
|
|
31
|
+
|
|
32
|
+
<a href="https://www.buymeacoffee.com/luligugithub">
|
|
33
|
+
<img src="./yellow-button.png" alt="Buy me a coffee" width="120">
|
|
34
|
+
</a>
|
|
35
|
+
|
|
19
36
|
## [1.5.1] - 2024-08-28
|
|
20
37
|
|
|
21
38
|
### Added
|
|
@@ -14,88 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
# Advanced configuration
|
|
16
16
|
|
|
17
|
-
## Run matterbridge
|
|
18
|
-
|
|
19
|
-
Create a systemctl configuration file for Matterbridge
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
sudo nano /etc/systemd/system/matterbridge.service
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
Add the following to this file, replacing twice (!) USER with your user name (e.g. WorkingDirectory=/home/pi/Matterbridge and User=pi):
|
|
26
|
-
|
|
27
|
-
You may need to adapt the configuration to your setup:
|
|
28
|
-
- execStart on some linux distribution can also be ExecStart==/usr/bin/matterbridge -service
|
|
29
|
-
|
|
30
|
-
```
|
|
31
|
-
[Unit]
|
|
32
|
-
Description=matterbridge
|
|
33
|
-
After=network-online.target
|
|
34
|
-
|
|
35
|
-
[Service]
|
|
36
|
-
Type=simple
|
|
37
|
-
ExecStart=matterbridge -service
|
|
38
|
-
WorkingDirectory=/home/<USER>/Matterbridge
|
|
39
|
-
StandardOutput=inherit
|
|
40
|
-
StandardError=inherit
|
|
41
|
-
Restart=always
|
|
42
|
-
RestartSec=10s
|
|
43
|
-
TimeoutStopSec=30s
|
|
44
|
-
User=<USER>
|
|
45
|
-
|
|
46
|
-
[Install]
|
|
47
|
-
WantedBy=multi-user.target
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
If you modify it after, then run:
|
|
51
|
-
|
|
52
|
-
```
|
|
53
|
-
sudo systemctl daemon-reload
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
### Start Matterbridge
|
|
57
|
-
|
|
58
|
-
```
|
|
59
|
-
sudo systemctl start matterbridge
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
### Stop Matterbridge
|
|
63
|
-
|
|
64
|
-
```
|
|
65
|
-
sudo systemctl stop matterbridge
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
### Show Matterbridge status
|
|
69
|
-
|
|
70
|
-
```
|
|
71
|
-
sudo systemctl status matterbridge.service
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
### View the log of Matterbridge in real time (this will show the log with colors)
|
|
75
|
-
|
|
76
|
-
```
|
|
77
|
-
sudo journalctl -u matterbridge.service -f --output cat
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### Delete the logs older then 3 days (all of them not only the ones of Matterbridge!)
|
|
81
|
-
|
|
82
|
-
```
|
|
83
|
-
sudo journalctl --vacuum-time=3d
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
### Enable Matterbridge to start automatically on boot
|
|
87
|
-
|
|
88
|
-
```
|
|
89
|
-
sudo systemctl enable matterbridge.service
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
### Disable Matterbridge from starting automatically on boot
|
|
93
|
-
|
|
94
|
-
```
|
|
95
|
-
sudo systemctl disable matterbridge.service
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
## Run matterbridge with docker
|
|
17
|
+
## Run matterbridge with docker and docker compose
|
|
99
18
|
|
|
100
19
|
The Matterbridge Docker image, which includes a manifest list for the linux/amd64, linux/arm64 and linux/arm/v7 architectures, is published on Docker Hub.
|
|
101
20
|
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# <img src="https://github.com/Luligu/matterbridge/blob/main/frontend/public/matterbridge%2064x64.png" alt="Matterbridge Logo" width="64px" height="64px"> Matterbridge
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/matterbridge)
|
|
4
|
+
[](https://www.npmjs.com/package/matterbridge)
|
|
5
|
+
[](https://hub.docker.com/r/luligu/matterbridge)
|
|
6
|
+
[](https://hub.docker.com/r/luligu/matterbridge)
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
[](https://www.npmjs.com/package/matter-history)
|
|
10
|
+
[](https://www.npmjs.com/package/node-ansi-logger)
|
|
11
|
+
[](https://www.npmjs.com/package/node-persist-manager)
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Advanced configuration
|
|
16
|
+
|
|
17
|
+
## Run matterbridge as a daemon with systemctl (Linux only)
|
|
18
|
+
|
|
19
|
+
Create a systemctl configuration file for Matterbridge
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
sudo nano /etc/systemd/system/matterbridge.service
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Add the following to this file, replacing twice (!) USER with your user name (e.g. WorkingDirectory=/home/pi/Matterbridge and User=pi):
|
|
26
|
+
|
|
27
|
+
You may need to adapt the configuration to your setup:
|
|
28
|
+
- execStart on some linux distribution can also be ExecStart==/usr/bin/matterbridge -service
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
[Unit]
|
|
32
|
+
Description=matterbridge
|
|
33
|
+
After=network-online.target
|
|
34
|
+
|
|
35
|
+
[Service]
|
|
36
|
+
Type=simple
|
|
37
|
+
ExecStart=matterbridge -service
|
|
38
|
+
WorkingDirectory=/home/<USER>/Matterbridge
|
|
39
|
+
StandardOutput=inherit
|
|
40
|
+
StandardError=inherit
|
|
41
|
+
Restart=always
|
|
42
|
+
RestartSec=10s
|
|
43
|
+
TimeoutStopSec=30s
|
|
44
|
+
User=<USER>
|
|
45
|
+
|
|
46
|
+
[Install]
|
|
47
|
+
WantedBy=multi-user.target
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
If you modify it after, then run:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
sudo systemctl daemon-reload
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Start Matterbridge
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
sudo systemctl start matterbridge
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Stop Matterbridge
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
sudo systemctl stop matterbridge
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Show Matterbridge status
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
sudo systemctl status matterbridge.service
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### View the log of Matterbridge in real time (this will show the log with colors)
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
sudo journalctl -u matterbridge.service -f --output cat
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Delete the logs older then 3 days (all of them not only the ones of Matterbridge!)
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
sudo journalctl --vacuum-time=3d
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Enable Matterbridge to start automatically on boot
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
sudo systemctl enable matterbridge.service
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Disable Matterbridge from starting automatically on boot
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
sudo systemctl disable matterbridge.service
|
|
96
|
+
```
|
package/README.md
CHANGED
|
@@ -42,6 +42,10 @@ The project is build on top of https://github.com/project-chip/matter.js.
|
|
|
42
42
|
|
|
43
43
|
A special thank to Apollon77 for his incredible work.
|
|
44
44
|
|
|
45
|
+
## Prerequisites
|
|
46
|
+
|
|
47
|
+
To run Matterbridge, you need either a [Node.js](https://nodejs.org/en/download/package-manager) environment or [Docker](https://docs.docker.com/get-started/get-docker/) installed on your system.
|
|
48
|
+
|
|
45
49
|
## Installation
|
|
46
50
|
|
|
47
51
|
Follow these steps to install Matterbridge:
|
|
@@ -120,7 +124,13 @@ Config editor:
|
|
|
120
124
|
|
|
121
125
|
## Advanced configurations
|
|
122
126
|
|
|
123
|
-
|
|
127
|
+
### Run matterbridge as a daemon with systemctl (Linux only)
|
|
128
|
+
|
|
129
|
+
[Advanced configurations](https://github.com/Luligu/matterbridge/blob/main/README-SERVICE.md)
|
|
130
|
+
|
|
131
|
+
### Run matterbridge with docker and docker compose
|
|
132
|
+
|
|
133
|
+
[Advanced configurations](https://github.com/Luligu/matterbridge/blob/main/README-DOCKER.md)
|
|
124
134
|
|
|
125
135
|
## Development
|
|
126
136
|
|
|
@@ -128,32 +138,54 @@ Config editor:
|
|
|
128
138
|
|
|
129
139
|
## Plugins
|
|
130
140
|
|
|
131
|
-
###
|
|
141
|
+
### Shelly
|
|
142
|
+
|
|
143
|
+
<a href="https://github.com/Luligu/matterbridge-shelly">
|
|
144
|
+
<img src="https://github.com/Luligu/matterbridge/blob/dev/screenshot/Shelly.png" alt="Shelly plugin logo" width="100" />
|
|
145
|
+
</a>
|
|
146
|
+
|
|
147
|
+
Matterbridge shelly plugin allows you to expose all Shelly Gen 1, Gen 2, Gen 3 and BLU devices to Matter.
|
|
148
|
+
|
|
149
|
+
Features:
|
|
150
|
+
|
|
151
|
+
- Shellies are automatically discovered using mDNS.
|
|
152
|
+
- Shelly wifi battery-powered devices are supported.
|
|
153
|
+
- Shelly wifi battery-powered devices with sleep_mode are supported.
|
|
154
|
+
- Shelly BLU devices are supported through local devices configured as ble gateway.
|
|
155
|
+
- Discovered shellies are stored in local storage for quick loading on startup.
|
|
156
|
+
- The components exposed are Light (with brightness and RGB color), Switch, Relay, Roller, Cover, PowerMeter, Temperature, Humidity and Input.
|
|
157
|
+
- All components expose the electrical measurements with the EveHistory cluster (displayed on HA), waiting for the controllers to upgrade to the Matter 1.3 specs.
|
|
158
|
+
- Shellies are controlled locally, eliminating the need for cloud or MQTT (which can both be disabled).
|
|
159
|
+
- Shelly Gen 1 devices are controlled using the CoIoT protocol (see the note below).
|
|
160
|
+
- Shelly Gen 2 and Gen 3 devices are controlled using WebSocket.
|
|
161
|
+
- The Matter device takes the name configured in the Shelly device's web page.
|
|
162
|
+
- If the device has a firmware update available, a message is displayed.
|
|
163
|
+
- If the device's CoIoT protocol is not correctly configured, a message is displayed.
|
|
164
|
+
- If the device cover/roller component is not calibrated, a message is displayed.
|
|
165
|
+
- A 10-minute timer checks if the device has reported within that time frame, and fetch un update.
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
### Zigbee2MQTT
|
|
132
170
|
|
|
133
|
-
|
|
171
|
+
<a href="https://github.com/Luligu/matterbridge-zigbee2mqtt">
|
|
172
|
+
<img src="https://github.com/Luligu/matterbridge/blob/dev/screenshot/Zigbee2MQTT.png" alt="Zigbee2MQTT plugin logo" width="100" />
|
|
173
|
+
</a>
|
|
134
174
|
|
|
135
175
|
Matterbridge zigbee2mqtt is a matterbridge production-level plugin that expose all zigbee2mqtt devices and groups to Matter.
|
|
136
176
|
|
|
137
177
|
No hub or dedicated hardware needed.
|
|
138
178
|
|
|
139
|
-
[somy-tahoma plugin](https://github.com/Luligu/matterbridge-somfy-tahoma)
|
|
140
179
|
|
|
141
|
-
Matterbridge Somfy Tahoma is a matterbridge production-level plugin that expose all Somfy Tahoma devices to Matter.
|
|
142
180
|
|
|
143
|
-
|
|
181
|
+
### Somfy tahoma
|
|
144
182
|
|
|
145
|
-
|
|
183
|
+
<a href="https://github.com/Luligu/matterbridge-somfy-tahoma">
|
|
184
|
+
<img src="https://github.com/Luligu/matterbridge/blob/dev/screenshot/Somfy.png" alt="Somfy plugin logo" width="100" />
|
|
185
|
+
</a>
|
|
146
186
|
|
|
147
|
-
|
|
187
|
+
Matterbridge Somfy Tahoma is a matterbridge production-level plugin that expose the Somfy Tahoma screen devices to Matter.
|
|
148
188
|
|
|
149
|
-
- Shellies are automatically discovered using mDNS.
|
|
150
|
-
- Discovered shellies are stored in local storage for quick loading on startup.
|
|
151
|
-
- In this first release, the components exposed are lights (with brightness), switches, rollers and meters.
|
|
152
|
-
- Shellies are controlled locally, eliminating the need for cloud or MQTT (which can be disabled).
|
|
153
|
-
- Shelly Gen 1 devices are controlled using the CoIoT protocol (see the note below).
|
|
154
|
-
- Shelly Gen 2 and Gen 3 devices are controlled using WebSocket.
|
|
155
|
-
- The Matter device takes the name configured in the Shelly device's web page.
|
|
156
|
-
- A 10-minute timer checks if the device has reported in that time.
|
|
157
189
|
|
|
158
190
|
### Accessory platform example
|
|
159
191
|
|
|
@@ -195,7 +227,12 @@ The history works in both bridge and childbridge mode.
|
|
|
195
227
|
|
|
196
228
|
The Eve app only shows the history when the plugins run like an AccessoryPlatform in childbridge mode (this means the plugin is paired directly).
|
|
197
229
|
|
|
198
|
-
## How to install and
|
|
230
|
+
## How to install and add a plugin with the frontend (best option)
|
|
231
|
+
|
|
232
|
+
Just open the frontend on the link provided in the log, select a plugin and click install.
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
## How to install and add a plugin manually from a terminal (from npm)
|
|
199
236
|
|
|
200
237
|
To install i.e. https://github.com/Luligu/matterbridge-zigbee2mqtt
|
|
201
238
|
|
package/dist/matterbridge.d.ts
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* @file matterbridge.ts
|
|
5
5
|
* @author Luca Liguori
|
|
6
6
|
* @date 2023-12-29
|
|
7
|
-
* @version 1.
|
|
7
|
+
* @version 1.5.2
|
|
8
8
|
*
|
|
9
|
-
* Copyright 2023, 2024 Luca Liguori.
|
|
9
|
+
* Copyright 2023, 2024, 2025 Luca Liguori.
|
|
10
10
|
*
|
|
11
11
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
12
|
* you may not use this file except in compliance with the License.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matterbridge.d.ts","sourceRoot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matterbridge.ts
|
|
5
5
|
* @author Luca Liguori
|
|
6
6
|
* @date 2023-12-29
|
|
7
|
-
* @version 1.
|
|
7
|
+
* @version 1.5.2
|
|
8
8
|
*
|
|
9
|
-
* Copyright 2023, 2024 Luca Liguori.
|
|
9
|
+
* Copyright 2023, 2024, 2025 Luca Liguori.
|
|
10
10
|
*
|
|
11
11
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
12
|
* you may not use this file except in compliance with the License.
|
|
@@ -38,6 +38,8 @@ import { AnsiLogger, UNDERLINE, UNDERLINEOFF, YELLOW, db, debugStringify, string
|
|
|
38
38
|
import { MatterbridgeDevice } from './matterbridgeDevice.js';
|
|
39
39
|
import { BridgedDeviceBasicInformation, BridgedDeviceBasicInformationCluster } from './cluster/BridgedDeviceBasicInformationCluster.js';
|
|
40
40
|
import { logInterfaces, wait, waiter, createZip } from './utils/utils.js';
|
|
41
|
+
import { PluginManager } from './pluginManager.js';
|
|
42
|
+
import { DeviceManager } from './deviceManager.js';
|
|
41
43
|
// @project-chip/matter-node.js
|
|
42
44
|
import { CommissioningController, CommissioningServer, MatterServer } from '@project-chip/matter-node.js';
|
|
43
45
|
import { BasicInformationCluster, ClusterServer, FixedLabelCluster, GeneralCommissioning, PowerSourceCluster, SwitchCluster, ThreadNetworkDiagnosticsCluster, getClusterNameById } from '@project-chip/matter-node.js/cluster';
|
|
@@ -48,8 +50,6 @@ import { ManualPairingCodeCodec, QrCodeSchema } from '@project-chip/matter-node.
|
|
|
48
50
|
import { StorageBackendDisk, StorageBackendJsonFile, StorageManager } from '@project-chip/matter-node.js/storage';
|
|
49
51
|
import { getParameter, getIntParameter, hasParameter } from '@project-chip/matter-node.js/util';
|
|
50
52
|
import { CryptoNode } from '@project-chip/matter-node.js/crypto';
|
|
51
|
-
import { PluginManager } from './pluginManager.js';
|
|
52
|
-
import { DeviceManager } from './deviceManager.js';
|
|
53
53
|
// Default colors
|
|
54
54
|
const plg = '\u001B[38;5;33m';
|
|
55
55
|
const dev = '\u001B[38;5;79m';
|
|
@@ -94,6 +94,8 @@ export class Matterbridge extends EventEmitter {
|
|
|
94
94
|
fileLogger: false,
|
|
95
95
|
matterLoggerLevel: Level.INFO,
|
|
96
96
|
matterFileLogger: false,
|
|
97
|
+
restartRequired: false,
|
|
98
|
+
refreshRequired: false,
|
|
97
99
|
};
|
|
98
100
|
homeDirectory = '';
|
|
99
101
|
rootDirectory = '';
|
|
@@ -378,6 +380,8 @@ export class Matterbridge extends EventEmitter {
|
|
|
378
380
|
- list: list the registered plugins
|
|
379
381
|
- loginterfaces: log the network interfaces (usefull for finding the name of the interface to use with -mdnsinterface option)
|
|
380
382
|
- logstorage: log the node storage
|
|
383
|
+
- sudo: force the use of sudo to install or update packages
|
|
384
|
+
- nosudo: force not to use sudo to install or update packages
|
|
381
385
|
- ssl: enable SSL for the frontend and WebSockerServer (certificates in .matterbridge/certs directory cert.pem, key.pem and ca.pem (optional))
|
|
382
386
|
- add [plugin path]: register the plugin from the given absolute or relative path
|
|
383
387
|
- add [plugin name]: register the globally installed plugin with the given name
|
|
@@ -2382,7 +2386,10 @@ export class Matterbridge extends EventEmitter {
|
|
|
2382
2386
|
args.splice(0, args.length, '/c', argstring);
|
|
2383
2387
|
command = 'cmd.exe';
|
|
2384
2388
|
}
|
|
2385
|
-
|
|
2389
|
+
// Decide when using sudo on linux
|
|
2390
|
+
// When you need sudo: Spawn stderr: npm error Error: EACCES: permission denied
|
|
2391
|
+
// When you don't need sudo: Failed to start child process "npm install -g matterbridge-eve-door": spawn sudo ENOENT
|
|
2392
|
+
if (hasParameter('sudo') || (process.platform === 'linux' && command === 'npm' && !hasParameter('docker') && !hasParameter('nosudo'))) {
|
|
2386
2393
|
args.unshift(command);
|
|
2387
2394
|
command = 'sudo';
|
|
2388
2395
|
}
|
|
@@ -2392,44 +2399,48 @@ export class Matterbridge extends EventEmitter {
|
|
|
2392
2399
|
stdio: ['inherit', 'pipe', 'pipe'],
|
|
2393
2400
|
});
|
|
2394
2401
|
childProcess.on('error', (err) => {
|
|
2395
|
-
this.log.error(`Failed to start child process: ${err.message}`);
|
|
2396
|
-
reject(err);
|
|
2402
|
+
this.log.error(`Failed to start child process "${cmdLine}": ${err.message}`);
|
|
2403
|
+
reject(err);
|
|
2397
2404
|
});
|
|
2398
2405
|
childProcess.on('close', (code, signal) => {
|
|
2399
2406
|
this.wssSendMessage('spawn', this.log.now(), 'Matterbridge:spawn', `child process closed with code ${code} and signal ${signal}`);
|
|
2400
2407
|
if (code === 0) {
|
|
2401
2408
|
if (cmdLine.startsWith('npm install -g'))
|
|
2402
2409
|
this.log.notice(`${cmdLine.replace('npm install -g ', '')} installed correctly`);
|
|
2410
|
+
this.log.debug(`Child process "${cmdLine}" closed with code ${code} and signal ${signal}`);
|
|
2403
2411
|
resolve();
|
|
2404
2412
|
}
|
|
2405
2413
|
else {
|
|
2406
|
-
this.log.error(`Child process
|
|
2407
|
-
reject(new Error(`Child process
|
|
2414
|
+
this.log.error(`Child process "${cmdLine}" closed with code ${code} and signal ${signal}`);
|
|
2415
|
+
reject(new Error(`Child process "${cmdLine}" closed with code ${code} and signal ${signal}`));
|
|
2408
2416
|
}
|
|
2409
2417
|
});
|
|
2410
2418
|
childProcess.on('exit', (code, signal) => {
|
|
2411
2419
|
this.wssSendMessage('spawn', this.log.now(), 'Matterbridge:spawn', `child process exited with code ${code} and signal ${signal}`);
|
|
2412
2420
|
if (code === 0) {
|
|
2421
|
+
this.log.debug(`Child process "${cmdLine}" exited with code ${code} and signal ${signal}`);
|
|
2413
2422
|
resolve();
|
|
2414
2423
|
}
|
|
2415
2424
|
else {
|
|
2416
|
-
this.log.error(`Child process exited with code ${code} and signal ${signal}`);
|
|
2417
|
-
reject(new Error(`Child process exited with code ${code} and signal ${signal}`));
|
|
2425
|
+
this.log.error(`Child process "${cmdLine}" exited with code ${code} and signal ${signal}`);
|
|
2426
|
+
reject(new Error(`Child process "${cmdLine}" exited with code ${code} and signal ${signal}`));
|
|
2418
2427
|
}
|
|
2419
2428
|
});
|
|
2420
2429
|
childProcess.on('disconnect', () => {
|
|
2421
|
-
this.log.debug(
|
|
2430
|
+
this.log.debug(`Child process "${cmdLine}" has been disconnected from the parent`);
|
|
2422
2431
|
resolve();
|
|
2423
2432
|
});
|
|
2424
2433
|
if (childProcess.stdout) {
|
|
2425
2434
|
childProcess.stdout.on('data', (data) => {
|
|
2426
2435
|
const message = data.toString().trim();
|
|
2436
|
+
this.log.debug(`Spawn stdout: ${message}`);
|
|
2427
2437
|
this.wssSendMessage('spawn', this.log.now(), 'Matterbridge:spawn', message);
|
|
2428
2438
|
});
|
|
2429
2439
|
}
|
|
2430
2440
|
if (childProcess.stderr) {
|
|
2431
2441
|
childProcess.stderr.on('data', (data) => {
|
|
2432
2442
|
const message = data.toString().trim();
|
|
2443
|
+
this.log.debug(`Spawn stderr: ${message}`);
|
|
2433
2444
|
this.wssSendMessage('spawn', this.log.now(), 'Matterbridge:spawn', message);
|
|
2434
2445
|
});
|
|
2435
2446
|
}
|
|
@@ -2882,6 +2893,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
2882
2893
|
// Handle the command setbridgemode from Settings
|
|
2883
2894
|
if (command === 'setbridgemode') {
|
|
2884
2895
|
this.log.debug(`setbridgemode: ${param}`);
|
|
2896
|
+
this.matterbridgeInformation.restartRequired = true;
|
|
2885
2897
|
await this.nodeContext?.set('bridgeMode', param);
|
|
2886
2898
|
res.json({ message: 'Command received' });
|
|
2887
2899
|
return;
|
|
@@ -3034,6 +3046,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
3034
3046
|
this.log.error('Error updating matterbridge');
|
|
3035
3047
|
}
|
|
3036
3048
|
await this.updateProcess();
|
|
3049
|
+
this.matterbridgeInformation.restartRequired = true;
|
|
3037
3050
|
res.json({ message: 'Command received' });
|
|
3038
3051
|
return;
|
|
3039
3052
|
}
|
|
@@ -3051,6 +3064,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
3051
3064
|
return;
|
|
3052
3065
|
this.plugins.saveConfigFromJson(plugin, req.body);
|
|
3053
3066
|
}
|
|
3067
|
+
this.matterbridgeInformation.restartRequired = true;
|
|
3054
3068
|
res.json({ message: 'Command received' });
|
|
3055
3069
|
return;
|
|
3056
3070
|
}
|
|
@@ -3066,7 +3080,8 @@ export class Matterbridge extends EventEmitter {
|
|
|
3066
3080
|
catch (error) {
|
|
3067
3081
|
this.log.error(`Error installing plugin ${plg}${param}${er}`);
|
|
3068
3082
|
}
|
|
3069
|
-
|
|
3083
|
+
this.matterbridgeInformation.restartRequired = true;
|
|
3084
|
+
// Also add the plugin to matterbridge so no return!
|
|
3070
3085
|
// res.json({ message: 'Command received' });
|
|
3071
3086
|
// return;
|
|
3072
3087
|
}
|