matterbridge 1.6.6-dev.13 → 1.6.6-dev.14
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/dist/matterbridge.js +3 -3
- package/dist/matterbridgePlatform.js +22 -6
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/matterbridge.js
CHANGED
|
@@ -2335,7 +2335,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
2335
2335
|
});
|
|
2336
2336
|
this.expressApp.get('/api/devices', (req, res) => {
|
|
2337
2337
|
this.log.debug('The frontend sent /api/devices');
|
|
2338
|
-
const
|
|
2338
|
+
const devices = [];
|
|
2339
2339
|
this.devices.forEach(async (device) => {
|
|
2340
2340
|
const pluginName = device.plugin ?? 'Unknown';
|
|
2341
2341
|
if (this.edge)
|
|
@@ -2353,7 +2353,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
2353
2353
|
if (!uniqueId)
|
|
2354
2354
|
uniqueId = device.getClusterServer(BridgedDeviceBasicInformationCluster)?.attributes.uniqueId?.getLocal() ?? 'Unknown';
|
|
2355
2355
|
const cluster = this.getClusterTextFromDevice(device);
|
|
2356
|
-
|
|
2356
|
+
devices.push({
|
|
2357
2357
|
pluginName,
|
|
2358
2358
|
type: device.name + ' (0x' + device.deviceType.toString(16).padStart(4, '0') + ')',
|
|
2359
2359
|
endpoint: device.number,
|
|
@@ -2365,7 +2365,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
2365
2365
|
cluster: cluster,
|
|
2366
2366
|
});
|
|
2367
2367
|
});
|
|
2368
|
-
res.json(
|
|
2368
|
+
res.json(devices);
|
|
2369
2369
|
});
|
|
2370
2370
|
this.expressApp.get('/api/devices_clusters/:selectedPluginName/:selectedDeviceEndpoint', (req, res) => {
|
|
2371
2371
|
const selectedPluginName = req.params.selectedPluginName;
|
|
@@ -71,17 +71,33 @@ export class MatterbridgePlatform {
|
|
|
71
71
|
return true;
|
|
72
72
|
}
|
|
73
73
|
validateDeviceWhiteBlackList(device, log = true) {
|
|
74
|
-
if (
|
|
74
|
+
if (!Array.isArray(device))
|
|
75
|
+
device = [device];
|
|
76
|
+
let blackListBlocked = 0;
|
|
77
|
+
if (isValidArray(this.config.blackList, 1)) {
|
|
78
|
+
for (const d of device)
|
|
79
|
+
if (this.config.blackList.includes(d))
|
|
80
|
+
blackListBlocked++;
|
|
81
|
+
}
|
|
82
|
+
if (blackListBlocked > 0) {
|
|
75
83
|
if (log)
|
|
76
|
-
this.log.info(`Skipping device ${CYAN}${device}${nf} because
|
|
84
|
+
this.log.info(`Skipping device ${CYAN}${device.join(', ')}${nf} because in blacklist`);
|
|
77
85
|
return false;
|
|
78
86
|
}
|
|
79
|
-
|
|
87
|
+
let whiteListPassed = 0;
|
|
88
|
+
if (isValidArray(this.config.whiteList, 1)) {
|
|
89
|
+
for (const d of device)
|
|
90
|
+
if (this.config.whiteList.includes(d))
|
|
91
|
+
whiteListPassed++;
|
|
92
|
+
}
|
|
93
|
+
else
|
|
94
|
+
whiteListPassed++;
|
|
95
|
+
if (whiteListPassed > 0) {
|
|
80
96
|
if (log)
|
|
81
|
-
this.log.info(`Skipping device ${CYAN}${device}${nf} because in
|
|
82
|
-
return
|
|
97
|
+
this.log.info(`Skipping device ${CYAN}${device.join(', ')}${nf} because not in whitelist`);
|
|
98
|
+
return true;
|
|
83
99
|
}
|
|
84
|
-
return
|
|
100
|
+
return false;
|
|
85
101
|
}
|
|
86
102
|
validateEntityBlackList(device, entity, log = true) {
|
|
87
103
|
if (isValidArray(this.config.entityBlackList, 1) && this.config.entityBlackList.find((e) => e === entity)) {
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "matterbridge",
|
|
3
|
-
"version": "1.6.6-dev.
|
|
3
|
+
"version": "1.6.6-dev.14",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "matterbridge",
|
|
9
|
-
"version": "1.6.6-dev.
|
|
9
|
+
"version": "1.6.6-dev.14",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@matter/main": "^0.11.9-alpha.0-20241207-b604cfa44",
|