matterbridge 1.5.6 → 1.5.8
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 +42 -0
- package/README-DEV.md +15 -4
- package/README-DOCKER.md +2 -1
- package/README-PODMAN.md +105 -0
- package/README-SERVICE.md +48 -5
- package/README.md +22 -14
- package/dist/matterbridge.d.ts +1 -1
- package/dist/matterbridge.d.ts.map +1 -1
- package/dist/matterbridge.js +34 -57
- package/dist/matterbridge.js.map +1 -1
- package/dist/matterbridgeDevice.d.ts +51 -24
- package/dist/matterbridgeDevice.d.ts.map +1 -1
- package/dist/matterbridgeDevice.js +39 -18
- package/dist/matterbridgeDevice.js.map +1 -1
- package/npm-shrinkwrap.json +108 -108
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,48 @@ If you like this project and find it useful, please consider giving it a star on
|
|
|
8
8
|
|
|
9
9
|
The Home Assistant Community Add-ons and plugins are not verified to work with Matterbridge. I strongly advise against using them. If you do use them and encounter an issue (which is likely because some do not meet the Matterbridge guidelines), please do not open an issue in the Matterbridge repository.
|
|
10
10
|
|
|
11
|
+
### New Apple firmware v. 18.0
|
|
12
|
+
|
|
13
|
+
Please read this: https://github.com/Luligu/matterbridge/discussions/135
|
|
14
|
+
|
|
15
|
+
## [1.5.8] - 2024-09-21
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- [readme]: Added podman guidelines to the README.md
|
|
20
|
+
- [readme]: Added instructions for setting permanent journalctl settings in service mode to prevent journal to grow
|
|
21
|
+
- [readme]: Added instructions for removing sudo password for npm install in service mode
|
|
22
|
+
- [readme]: Refactor systemd instructions for Matterbridge service
|
|
23
|
+
- [readme]: Added link to install matterbridge like ha addon https://github.com/Luligu/matterbridge-home-assistant-addon
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- [package]: Update matter-node.js to 0.10.5.
|
|
28
|
+
- [package]: Update matter-history to 1.1.15.
|
|
29
|
+
- [package]: Update dependencies.
|
|
30
|
+
- [matterbridge]: Reset session informations when the controllers are not connected.
|
|
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
|
+
|
|
36
|
+
## [1.5.7] - 2024-09-17
|
|
37
|
+
|
|
38
|
+
### Added
|
|
39
|
+
|
|
40
|
+
- [matterbridge]: Added the [Official Matterbridge Home Assistant Add-on](https://github.com/Luligu/matterbridge-home-assistant-addon)
|
|
41
|
+
|
|
42
|
+
### Changed
|
|
43
|
+
|
|
44
|
+
- [electricalSensor]: Refactor the getDefaultElectricalEnergyMeasurementClusterServer and getDefaultElectricalPowerMeasurementClusterServer
|
|
45
|
+
- [package]: Update matter-node.js to 0.10.3.
|
|
46
|
+
- [package]: Update matter-history to 1.1.14.
|
|
47
|
+
- [package]: Update dependencies.
|
|
48
|
+
|
|
49
|
+
<a href="https://www.buymeacoffee.com/luligugithub">
|
|
50
|
+
<img src="./yellow-button.png" alt="Buy me a coffee" width="120">
|
|
51
|
+
</a>
|
|
52
|
+
|
|
11
53
|
## [1.5.6] - 2024-09-13
|
|
12
54
|
|
|
13
55
|
### Added
|
package/README-DEV.md
CHANGED
|
@@ -19,36 +19,47 @@
|
|
|
19
19
|
Matterbridge exports from:
|
|
20
20
|
|
|
21
21
|
"matterbridge"
|
|
22
|
+
|
|
22
23
|
- Matterbridge and all Matterbridge related classes.
|
|
23
24
|
- All relevant matter-node.js or matter.js clusters, classes and functions.
|
|
24
25
|
|
|
25
26
|
"matterbridge/cluster"
|
|
27
|
+
|
|
26
28
|
- All clusters not present in matter.js or modified.
|
|
27
29
|
|
|
28
30
|
"matterbridge/utils"
|
|
31
|
+
|
|
29
32
|
- All general utils and colorUtils functions.
|
|
30
33
|
|
|
31
34
|
"matterbridge/history"
|
|
35
|
+
|
|
32
36
|
- MatterHistory class.
|
|
33
37
|
|
|
34
38
|
"matterbridge/logger"
|
|
39
|
+
|
|
35
40
|
- NodeAnsiLogger class.
|
|
36
41
|
|
|
37
42
|
"matterbridge/storage"
|
|
43
|
+
|
|
38
44
|
- NodeStorage classes.
|
|
39
45
|
|
|
40
|
-
#
|
|
46
|
+
# ****\*\*****
|
|
47
|
+
|
|
41
48
|
A plugin must never install or import from `matter-node.js` or `matter.js` directly, as this leads to a second instance of `matter.js`, causing instability and unpredictable errors such as "The only instance is Endpoint". Additionally, when Matterbridge updates the `matter.js` version, it should be consistent across all plugins.
|
|
42
|
-
|
|
49
|
+
|
|
50
|
+
# ****\*\*****
|
|
51
|
+
|
|
43
52
|
A plugin must never install Matterbridge (neither as dependencies nor as devDependencies). Matterbridge must be linked to the plugin:
|
|
53
|
+
|
|
44
54
|
```json
|
|
45
55
|
"scripts": {
|
|
46
56
|
'''
|
|
47
57
|
"install": "node link-matterbridge-script.js",
|
|
48
58
|
'''
|
|
49
|
-
}
|
|
59
|
+
}
|
|
50
60
|
```
|
|
51
|
-
|
|
61
|
+
|
|
62
|
+
# ****\*\*****
|
|
52
63
|
|
|
53
64
|
In the next releases I will remove the duplicated exports so please update your plugins.
|
|
54
65
|
|
package/README-DOCKER.md
CHANGED
|
@@ -28,6 +28,7 @@ mkdir -p ./Matterbridge
|
|
|
28
28
|
mkdir -p ./.matterbridge
|
|
29
29
|
sudo chown -R $USER:$USER ./Matterbridge ./.matterbridge
|
|
30
30
|
```
|
|
31
|
+
|
|
31
32
|
You may need to adapt the script to your setup.
|
|
32
33
|
|
|
33
34
|
### Run the Docker container and start it
|
|
@@ -40,6 +41,7 @@ docker run --name matterbridge \
|
|
|
40
41
|
-v ${HOME}/.matterbridge:/root/.matterbridge \
|
|
41
42
|
--network host --restart always -d luligu/matterbridge:latest
|
|
42
43
|
```
|
|
44
|
+
|
|
43
45
|
You may need to adapt the script to your setup.
|
|
44
46
|
|
|
45
47
|
### Run with docker compose
|
|
@@ -113,4 +115,3 @@ docker logs matterbridge
|
|
|
113
115
|
```
|
|
114
116
|
docker logs --tail 1000 -f matterbridge
|
|
115
117
|
```
|
|
116
|
-
|
package/README-PODMAN.md
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
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
|
+
## Install Podman if it is not already installed
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
cd ~
|
|
21
|
+
sudo apt update
|
|
22
|
+
sudo apt install podman -y
|
|
23
|
+
podman --version
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Run matterbridge with podman
|
|
27
|
+
|
|
28
|
+
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 and can be used with podman.
|
|
29
|
+
|
|
30
|
+
Podman handles container restarts a little differently than Docker. The --restart always flag doesn’t work exactly the same. If you want the container to automatically restart when the system reboots or if it crashes, you can create a systemd unit for the Podman container.
|
|
31
|
+
|
|
32
|
+
### First create the Matterbridge directories
|
|
33
|
+
|
|
34
|
+
This will create the required directories if they don't exist
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
cd ~
|
|
38
|
+
mkdir -p ./Matterbridge
|
|
39
|
+
mkdir -p ./.matterbridge
|
|
40
|
+
sudo chown -R $USER:$USER ./Matterbridge ./.matterbridge
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
You may need to adapt the script to your setup:
|
|
44
|
+
- ./Matterbridge is the position outside of the container of your matterbridge plugin directory (inside your home directory).
|
|
45
|
+
- ./.matterbridge is the position outside of the container of your matterbridge storage directory (inside your home directory).
|
|
46
|
+
|
|
47
|
+
### Run the Podman container (root mode) and start it
|
|
48
|
+
|
|
49
|
+
The container must have full access to the host network (needed for matter mdns).
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
podman run --name matterbridge \
|
|
53
|
+
-v ~/Matterbridge:/root/Matterbridge \
|
|
54
|
+
-v ~/.matterbridge:/root/.matterbridge \
|
|
55
|
+
--network host --restart always -d docker.io/luligu/matterbridge:latest
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
You may need to adapt the script to your setup:
|
|
59
|
+
- ~/Matterbridge is the position outside of the container of your matterbridge plugin directory.
|
|
60
|
+
- ~/.matterbridge is the position outside of the container of your matterbridge storage directory.
|
|
61
|
+
|
|
62
|
+
### Integrate the mattebridge podman container with systemd for automatic startup after reboots
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
podman generate systemd --name matterbridge --files --new
|
|
66
|
+
sudo mv container-matterbridge.service /etc/systemd/system/
|
|
67
|
+
sudo systemctl enable container-matterbridge
|
|
68
|
+
sudo systemctl start container-matterbridge
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Start the Podman container
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
podman start matterbridge
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Stop the Podman container
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
podman stop matterbridge
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Restart the Podman container
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
podman restart matterbridge
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Remove the Podman container
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
podman rm matterbridge
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Shows the logs
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
podman logs matterbridge
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Shows the logs real time (tail)
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
podman logs --tail 1000 -f matterbridge
|
|
105
|
+
```
|
package/README-SERVICE.md
CHANGED
|
@@ -25,7 +25,8 @@ sudo nano /etc/systemd/system/matterbridge.service
|
|
|
25
25
|
Add the following to this file, replacing twice (!) USER with your user name (e.g. WorkingDirectory=/home/pi/Matterbridge and User=pi):
|
|
26
26
|
|
|
27
27
|
You may need to adapt the configuration to your setup:
|
|
28
|
-
|
|
28
|
+
|
|
29
|
+
- execStart on some linux distribution can also be ExecStart==/usr/bin/matterbridge -service
|
|
29
30
|
|
|
30
31
|
```
|
|
31
32
|
[Unit]
|
|
@@ -71,6 +72,18 @@ sudo systemctl stop matterbridge
|
|
|
71
72
|
sudo systemctl status matterbridge.service
|
|
72
73
|
```
|
|
73
74
|
|
|
75
|
+
### Enable Matterbridge to start automatically on boot
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
sudo systemctl enable matterbridge.service
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Disable Matterbridge from starting automatically on boot
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
sudo systemctl disable matterbridge.service
|
|
85
|
+
```
|
|
86
|
+
|
|
74
87
|
### View the log of Matterbridge in real time (this will show the log with colors)
|
|
75
88
|
|
|
76
89
|
```
|
|
@@ -83,14 +96,44 @@ sudo journalctl -u matterbridge.service -f --output cat
|
|
|
83
96
|
sudo journalctl --vacuum-time=3d
|
|
84
97
|
```
|
|
85
98
|
|
|
86
|
-
|
|
99
|
+
If you want to make the setting permanent edit
|
|
100
|
+
```
|
|
101
|
+
sudo nano /etc/systemd/journald.conf
|
|
102
|
+
```
|
|
103
|
+
add
|
|
104
|
+
```
|
|
105
|
+
SystemMaxUse=3d
|
|
106
|
+
```
|
|
107
|
+
save it and run
|
|
108
|
+
```
|
|
109
|
+
sudo systemctl restart systemd-journald
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Verify that with your distro you can run sudo npm install -g matterbridge without the password
|
|
113
|
+
|
|
114
|
+
Run the following command to verify if you can install Matterbridge globally without being prompted for a password:
|
|
87
115
|
|
|
88
116
|
```
|
|
89
|
-
sudo
|
|
117
|
+
sudo npm install -g matterbridge
|
|
90
118
|
```
|
|
119
|
+
If you are not prompted for a password, no further action is required.
|
|
91
120
|
|
|
92
|
-
|
|
121
|
+
If that is not the case open the sudoers file for editing using visudo
|
|
122
|
+
```
|
|
123
|
+
sudo visudo
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
add this line replacing USER with your user name (e.g. radxa ALL=(ALL) NOPASSWD: ALL)
|
|
93
127
|
|
|
94
128
|
```
|
|
95
|
-
|
|
129
|
+
<USER> ALL=(ALL) NOPASSWD: ALL
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
or if you prefers to only give access to npm without password try (e.g. radxa ALL=(ALL) NOPASSWD: /usr/bin/npm)
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
<USER> ALL=(ALL) NOPASSWD: /usr/bin/npm
|
|
96
136
|
```
|
|
137
|
+
|
|
138
|
+
save the file and restart the system.
|
|
139
|
+
|
package/README.md
CHANGED
|
@@ -63,10 +63,12 @@ sudo npm install -g matterbridge
|
|
|
63
63
|
Test the installation with:
|
|
64
64
|
|
|
65
65
|
```
|
|
66
|
-
matterbridge
|
|
66
|
+
matterbridge
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
Now it is possible to open the frontend at the link provided in the log (e.g. http://MATTERBIDGE-IPV4-ADDRESS:8283)
|
|
69
|
+
Now it is possible to open the frontend at the link provided in the log (e.g. http://MATTERBIDGE-IPV4-ADDRESS:8283).
|
|
70
|
+
|
|
71
|
+
You can then change the bridge mode from the frontend.
|
|
70
72
|
|
|
71
73
|
## Usage
|
|
72
74
|
|
|
@@ -76,6 +78,8 @@ Now it is possible to open the frontend at the link provided in the log (e.g. ht
|
|
|
76
78
|
matterbridge -bridge
|
|
77
79
|
```
|
|
78
80
|
|
|
81
|
+
This force Matterbridge to load in bridge mode.
|
|
82
|
+
|
|
79
83
|
Matterbridge only exposes itself, and you have to pair it scanning the QR code shown in the frontend or in the console.
|
|
80
84
|
|
|
81
85
|
### mode childbridge
|
|
@@ -84,6 +88,8 @@ Matterbridge only exposes itself, and you have to pair it scanning the QR code s
|
|
|
84
88
|
matterbridge -childbridge
|
|
85
89
|
```
|
|
86
90
|
|
|
91
|
+
This force Matterbridge to load in childbridge mode.
|
|
92
|
+
|
|
87
93
|
Matterbridge exposes each registered plugins, and you have to pair each one by scanning the QR code shown in the frontend or in the console.
|
|
88
94
|
|
|
89
95
|
### Use matterbridge -help to see the command line syntax
|
|
@@ -101,11 +107,7 @@ You can change the default port by adding the frontend parameter when you run it
|
|
|
101
107
|
Here's how to specify a different port number:
|
|
102
108
|
|
|
103
109
|
```
|
|
104
|
-
matterbridge -
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
```
|
|
108
|
-
matterbridge -childbridge -frontend [port number]
|
|
110
|
+
matterbridge -frontend [port number]
|
|
109
111
|
```
|
|
110
112
|
|
|
111
113
|
From the frontend you can do all operations in an easy way.
|
|
@@ -132,9 +134,17 @@ Config editor:
|
|
|
132
134
|
|
|
133
135
|
[Advanced configurations](https://github.com/Luligu/matterbridge/blob/main/README-DOCKER.md)
|
|
134
136
|
|
|
135
|
-
###
|
|
137
|
+
### Run matterbridge with podman
|
|
138
|
+
|
|
139
|
+
[Advanced configurations](https://github.com/Luligu/matterbridge/blob/main/README-PODMAN.md)
|
|
140
|
+
|
|
141
|
+
### Run matterbridge as an home assistant add-on with the official add-on
|
|
142
|
+
|
|
143
|
+
[Advanced configurations](https://github.com/Luligu/matterbridge-home-assistant-addon)
|
|
136
144
|
|
|
137
|
-
|
|
145
|
+
### Other Home Assistant Community Add-ons
|
|
146
|
+
|
|
147
|
+
The other Home Assistant Community Add-ons and plugins are not verified to work with Matterbridge. I strongly advise against using them. If you do use them and encounter an issue (which is likely because some do not meet the Matterbridge guidelines), please do not open an issue in the Matterbridge repository.
|
|
138
148
|
|
|
139
149
|
## Development
|
|
140
150
|
|
|
@@ -168,8 +178,6 @@ Features:
|
|
|
168
178
|
- If the device cover/roller component is not calibrated, a message is displayed.
|
|
169
179
|
- A 10-minute timer checks if the device has reported within that time frame, and fetch un update.
|
|
170
180
|
|
|
171
|
-
|
|
172
|
-
|
|
173
181
|
### Zigbee2MQTT
|
|
174
182
|
|
|
175
183
|
<a href="https://github.com/Luligu/matterbridge-zigbee2mqtt">
|
|
@@ -180,8 +188,6 @@ Matterbridge zigbee2mqtt is a matterbridge production-level plugin that expose a
|
|
|
180
188
|
|
|
181
189
|
No hub or dedicated hardware needed.
|
|
182
190
|
|
|
183
|
-
|
|
184
|
-
|
|
185
191
|
### Somfy tahoma
|
|
186
192
|
|
|
187
193
|
<a href="https://github.com/Luligu/matterbridge-somfy-tahoma">
|
|
@@ -190,7 +196,6 @@ No hub or dedicated hardware needed.
|
|
|
190
196
|
|
|
191
197
|
Matterbridge Somfy Tahoma is a matterbridge production-level plugin that expose the Somfy Tahoma screen devices to Matter.
|
|
192
198
|
|
|
193
|
-
|
|
194
199
|
### Accessory platform example
|
|
195
200
|
|
|
196
201
|
This an example of an accessory platform plugin.
|
|
@@ -206,6 +211,7 @@ An Accessory platform plugin only exposes one device.
|
|
|
206
211
|
This an example of a dynamic platform plugin.
|
|
207
212
|
|
|
208
213
|
It exposes:
|
|
214
|
+
|
|
209
215
|
- a switch with onOff cluster
|
|
210
216
|
- a light with onOff
|
|
211
217
|
- a light with onOff and levelControl (dimmer)
|
|
@@ -339,10 +345,12 @@ So far is the only controller supporting some Matter 1.2 and 1.3 device type:
|
|
|
339
345
|
- deviceEnergyManagement code 0x050d (Matter 1.3 with only DeviceEnergyManagementMode cluster)
|
|
340
346
|
|
|
341
347
|
Electrical measurements:
|
|
348
|
+
|
|
342
349
|
- electrical measurements from EveHistoryCluster (used in Matterbridge plugins)
|
|
343
350
|
- electricalSensor code 0x0510 with clusters: ElectricalPowerMeasurement and ElectricalEnergyMeasurement (still in dev but fully working!)
|
|
344
351
|
|
|
345
352
|
Other supported cluster:
|
|
353
|
+
|
|
346
354
|
- ModeSelect
|
|
347
355
|
|
|
348
356
|
## Home Assistant issues (Matter Server for HA is still in Beta)
|
package/dist/matterbridge.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ export declare class Matterbridge extends EventEmitter {
|
|
|
40
40
|
matterbridgeQrPairingCode: string | undefined;
|
|
41
41
|
matterbridgeManualPairingCode: string | undefined;
|
|
42
42
|
matterbridgeFabricInformations: SanitizedExposedFabricInformation[];
|
|
43
|
-
matterbridgeSessionInformations:
|
|
43
|
+
matterbridgeSessionInformations: SanitizedSessionInformation[];
|
|
44
44
|
matterbridgePaired: boolean;
|
|
45
45
|
matterbridgeConnected: boolean;
|
|
46
46
|
bridgeMode: 'bridge' | 'childbridge' | 'controller' | '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matterbridge.d.ts","sourceRoot":"","sources":["../src/matterbridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AASH,OAAO,YAAY,MAAM,QAAQ,CAAC;AAQlC,OAAO,EAAE,UAAU,EAAyK,MAAM,kBAAkB,CAAC;AAGrN,OAAO,EAAE,kBAAkB,EAAgC,MAAM,yBAAyB,CAAC;AAE3F,OAAO,EAAwB,uBAAuB,EAAsC,iCAAiC,EAAE,2BAA2B,EAAsB,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAkClO;;GAEG;AACH,qBAAa,YAAa,SAAQ,YAAY;IACrC,iBAAiB,EAAE,iBAAiB,CAezC;IAEK,uBAAuB,EAAE,uBAAuB,CAyBrD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xI,wIAAwI;IAExI;;;;;OAKG;YACW,kBAAkB;IA4BhC;;;;;OAKG;YACW,uBAAuB;IAkBrC;;;OAGG;YACW,iBAAiB;IAS/B;;;;OAIG;IACH,OAAO,CAAC,kBAAkB;IAmB1B;;;OAGG;YACW,iBAAiB;IAY/B;;OAEG;YACW,gBAAgB;IAc9B;;;;OAIG;YACW,sBAAsB;IA6CpC;;;;;;OAMG;YACW,wBAAwB;IAqKtC;;;;;;;;;;;;;;;;;OAiBG;YACW,gCAAgC;IA4B9C;;;;;;OAMG;YACW,gCAAgC;IAqC9C;;;;;;;OAOG;YACW,uBAAuB;IAuDrC;;;;;OAKG;IACH,OAAO,CAAC,0BAA0B;IAclC;;;;;OAKG;IACH,OAAO,CAAC,0BAA0B;IA4BlC;;;;;OAKG;IACH,OAAO,CAAC,kCAAkC;IAM1C;;;;OAIG;IACH,OAAO,CAAC,yBAAyB;IAWjC;;;;;OAKG;IACH,OAAO,CAAC,qBAAqB;IAM7B,OAAO,CAAC,eAAe,CAoCrB;IAEF;;;OAGG;YACW,wBAAwB;IAgCtC;;;;;OAKG;YACW,YAAY;IAqF1B;;;;;;;OAOG;IACH,OAAO,CAAC,cAAc;IAuCtB;;;;OAIG;IACG,kBAAkB,CAAC,IAAI,SAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IA0sBpD;;;;OAIG;IACH,OAAO,CAAC,wBAAwB;IAmDhC;;;;;OAKG;IACU,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,SAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAsEtG;;;;;OAKG;IACU,aAAa;IAa1B;;;;;OAKG;IACI,uBAAuB,IAAI,OAAO;CAI1C"}
|
package/dist/matterbridge.js
CHANGED
|
@@ -110,8 +110,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
110
110
|
matterbridgeQrPairingCode = undefined;
|
|
111
111
|
matterbridgeManualPairingCode = undefined;
|
|
112
112
|
matterbridgeFabricInformations = [];
|
|
113
|
-
|
|
114
|
-
matterbridgeSessionInformations = new Map();
|
|
113
|
+
matterbridgeSessionInformations = [];
|
|
115
114
|
matterbridgePaired = false;
|
|
116
115
|
matterbridgeConnected = false;
|
|
117
116
|
bridgeMode = '';
|
|
@@ -2014,10 +2013,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
2014
2013
|
if (this.bridgeMode === 'bridge') {
|
|
2015
2014
|
this.matterbridgePaired = true;
|
|
2016
2015
|
this.matterbridgeConnected = true;
|
|
2017
|
-
|
|
2018
|
-
sessionInformations.forEach((session) => {
|
|
2019
|
-
this.matterbridgeSessionInformations.set(session.name, this.sanitizeSessionInformation([session])[0]);
|
|
2020
|
-
});
|
|
2016
|
+
this.matterbridgeSessionInformations = this.sanitizeSessionInformation(sessionInformations);
|
|
2021
2017
|
}
|
|
2022
2018
|
if (this.bridgeMode === 'childbridge') {
|
|
2023
2019
|
const plugin = this.plugins.get(pluginName);
|
|
@@ -2027,35 +2023,17 @@ export class Matterbridge extends EventEmitter {
|
|
|
2027
2023
|
plugin.sessionInformations = this.sanitizeSessionInformation(sessionInformations);
|
|
2028
2024
|
}
|
|
2029
2025
|
}
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
plugin.error = true;
|
|
2040
|
-
this.log.error(`Error configuring plugin ${plg}${plugin.name}${er}`, error);
|
|
2041
|
-
}
|
|
2042
|
-
}
|
|
2043
|
-
}
|
|
2044
|
-
if (this.bridgeMode === 'childbridge') {
|
|
2045
|
-
for (const plugin of this.plugins) {
|
|
2046
|
-
if (plugin.name === pluginName && plugin.loaded === true && plugin.started === true && plugin.configured !== true) {
|
|
2047
|
-
try {
|
|
2048
|
-
this.configurePlugin(plugin); // No await do it asyncronously
|
|
2049
|
-
} catch (error) {
|
|
2050
|
-
plugin.error = true;
|
|
2051
|
-
this.log.error(`Error configuring plugin ${plg}${plugin.name}${er}`, error);
|
|
2052
|
-
}
|
|
2053
|
-
}
|
|
2026
|
+
}
|
|
2027
|
+
else {
|
|
2028
|
+
if (this.bridgeMode === 'bridge') {
|
|
2029
|
+
this.matterbridgeSessionInformations = [];
|
|
2030
|
+
}
|
|
2031
|
+
if (this.bridgeMode === 'childbridge') {
|
|
2032
|
+
const plugin = this.plugins.get(pluginName);
|
|
2033
|
+
if (plugin) {
|
|
2034
|
+
plugin.sessionInformations = [];
|
|
2054
2035
|
}
|
|
2055
|
-
|
|
2056
|
-
// logEndpoint(commissioningServer.getRootEndpoint());
|
|
2057
|
-
}, 2000);
|
|
2058
|
-
*/
|
|
2036
|
+
}
|
|
2059
2037
|
}
|
|
2060
2038
|
},
|
|
2061
2039
|
commissioningChangedCallback: async (fabricIndex) => {
|
|
@@ -2067,8 +2045,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
2067
2045
|
if (pluginName === 'Matterbridge') {
|
|
2068
2046
|
await this.matterbridgeContext?.clearAll();
|
|
2069
2047
|
this.matterbridgeFabricInformations = [];
|
|
2070
|
-
|
|
2071
|
-
this.matterbridgeSessionInformations.clear();
|
|
2048
|
+
this.matterbridgeSessionInformations = [];
|
|
2072
2049
|
this.matterbridgePaired = false;
|
|
2073
2050
|
this.matterbridgeConnected = false;
|
|
2074
2051
|
}
|
|
@@ -2221,8 +2198,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
2221
2198
|
this.matterbridgeQrPairingCode = qrPairingCode;
|
|
2222
2199
|
this.matterbridgeManualPairingCode = manualPairingCode;
|
|
2223
2200
|
this.matterbridgeFabricInformations = [];
|
|
2224
|
-
|
|
2225
|
-
this.matterbridgeSessionInformations.clear();
|
|
2201
|
+
this.matterbridgeSessionInformations = [];
|
|
2226
2202
|
this.matterbridgePaired = false;
|
|
2227
2203
|
this.matterbridgeConnected = false;
|
|
2228
2204
|
}
|
|
@@ -2248,8 +2224,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
2248
2224
|
});
|
|
2249
2225
|
if (pluginName === 'Matterbridge') {
|
|
2250
2226
|
this.matterbridgeFabricInformations = this.sanitizeFabricInformations(fabricInfo);
|
|
2251
|
-
|
|
2252
|
-
this.matterbridgeSessionInformations.clear();
|
|
2227
|
+
this.matterbridgeSessionInformations = [];
|
|
2253
2228
|
this.matterbridgePaired = true;
|
|
2254
2229
|
}
|
|
2255
2230
|
if (pluginName !== 'Matterbridge') {
|
|
@@ -2288,27 +2263,29 @@ export class Matterbridge extends EventEmitter {
|
|
|
2288
2263
|
* @returns An array of sanitized session information objects.
|
|
2289
2264
|
*/
|
|
2290
2265
|
sanitizeSessionInformation(sessionInfo) {
|
|
2291
|
-
return sessionInfo
|
|
2266
|
+
return sessionInfo
|
|
2267
|
+
.filter((session) => session.isPeerActive)
|
|
2268
|
+
.map((session) => {
|
|
2292
2269
|
return {
|
|
2293
|
-
name:
|
|
2294
|
-
nodeId:
|
|
2295
|
-
peerNodeId:
|
|
2296
|
-
fabric:
|
|
2270
|
+
name: session.name,
|
|
2271
|
+
nodeId: session.nodeId.toString(),
|
|
2272
|
+
peerNodeId: session.peerNodeId.toString(),
|
|
2273
|
+
fabric: session.fabric
|
|
2297
2274
|
? {
|
|
2298
|
-
fabricIndex:
|
|
2299
|
-
fabricId:
|
|
2300
|
-
nodeId:
|
|
2301
|
-
rootNodeId:
|
|
2302
|
-
rootVendorId:
|
|
2303
|
-
rootVendorName: this.getVendorIdName(
|
|
2304
|
-
label:
|
|
2275
|
+
fabricIndex: session.fabric.fabricIndex,
|
|
2276
|
+
fabricId: session.fabric.fabricId.toString(),
|
|
2277
|
+
nodeId: session.fabric.nodeId.toString(),
|
|
2278
|
+
rootNodeId: session.fabric.rootNodeId.toString(),
|
|
2279
|
+
rootVendorId: session.fabric.rootVendorId,
|
|
2280
|
+
rootVendorName: this.getVendorIdName(session.fabric.rootVendorId),
|
|
2281
|
+
label: session.fabric.label,
|
|
2305
2282
|
}
|
|
2306
2283
|
: undefined,
|
|
2307
|
-
isPeerActive:
|
|
2308
|
-
secure:
|
|
2309
|
-
lastInteractionTimestamp:
|
|
2310
|
-
lastActiveTimestamp:
|
|
2311
|
-
numberOfActiveSubscriptions:
|
|
2284
|
+
isPeerActive: session.isPeerActive,
|
|
2285
|
+
secure: session.secure,
|
|
2286
|
+
lastInteractionTimestamp: session.lastInteractionTimestamp?.toString(),
|
|
2287
|
+
lastActiveTimestamp: session.lastActiveTimestamp?.toString(),
|
|
2288
|
+
numberOfActiveSubscriptions: session.numberOfActiveSubscriptions,
|
|
2312
2289
|
};
|
|
2313
2290
|
});
|
|
2314
2291
|
}
|