matterbridge 1.6.6-dev.2 → 1.6.6-dev.3

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
@@ -16,10 +16,23 @@ Tamer (https://github.com/tammeryousef1006) has created the Matterbridge Discord
16
16
 
17
17
  ## [1.6.6] - 2024-12-05
18
18
 
19
+ ### Added
20
+
21
+ - [deviceTypes]: Add device type airConditioner.
22
+ - [docker]: Add matterbridge-hass to docker dev.
23
+ - [platform]: Added validateDeviceWhiteBlackList and validateEntityBlackList to be use consistently by all plugins.
24
+
19
25
  ### Changed
20
26
 
21
- - [plugin]: Removed check on types since we are moving to production plugins.
27
+ - [plugin]: Removed check on package types since we are moving to production plugins.
28
+ - [package]: Set node version to 18, 20 and 22.
22
29
  - [package]: Update dependencies.
30
+ - [levelControl]: Set default to OnOff.Feature.Lighting.
31
+ - [jest]: Update Jest tests.
32
+
33
+ ### Fixed
34
+
35
+ - [device]: Fix typos in Device and Endpoint.
23
36
 
24
37
  <a href="https://www.buymeacoffee.com/luligugithub">
25
38
  <img src="./yellow-button.png" alt="Buy me a coffee" width="120">
@@ -1,5 +1,7 @@
1
1
  import { MatterbridgeDevice } from './matterbridgeDevice.js';
2
+ import { CYAN, nf, wr } from 'node-ansi-logger';
2
3
  import { MatterbridgeEndpoint } from './matterbridgeEndpoint.js';
4
+ import { isValidArray, isValidObject } from './utils/utils.js';
3
5
  export class MatterbridgePlatform {
4
6
  matterbridge;
5
7
  log;
@@ -39,13 +41,16 @@ export class MatterbridgePlatform {
39
41
  await this.matterbridge.removeBridgedEndpoint(this.name, device);
40
42
  }
41
43
  async unregisterAllDevices() {
42
- await this.matterbridge.removeAllBridgedDevices(this.name);
44
+ if (this.matterbridge.edge)
45
+ await this.matterbridge.removeAllBridgedEndpoints(this.name);
46
+ else
47
+ await this.matterbridge.removeAllBridgedDevices(this.name);
43
48
  }
44
49
  verifyMatterbridgeVersion(requiredVersion) {
45
50
  const compareVersions = (matterbridgeVersion, requiredVersion) => {
46
51
  const stripTag = (v) => {
47
52
  const parts = v.split('-');
48
- return parts.length > 0 ? parts[0] : v;
53
+ return parts[0];
49
54
  };
50
55
  const v1Parts = stripTag(matterbridgeVersion).split('.').map(Number);
51
56
  const v2Parts = stripTag(requiredVersion).split('.').map(Number);
@@ -65,4 +70,26 @@ export class MatterbridgePlatform {
65
70
  return false;
66
71
  return true;
67
72
  }
73
+ validateDeviceWhiteBlackList(device) {
74
+ if (isValidArray(this.config.whiteList, 1) && !this.config.whiteList.includes(device)) {
75
+ this.log.info(`Skipping device ${CYAN}${device}${nf} because not in whitelist`);
76
+ return false;
77
+ }
78
+ if (isValidArray(this.config.blackList, 1) && this.config.blackList.includes(device)) {
79
+ this.log.info(`Skipping device ${CYAN}${device}${nf} because in blacklist`);
80
+ return false;
81
+ }
82
+ return true;
83
+ }
84
+ validateEntityBlackList(device, entity) {
85
+ if (isValidArray(this.config.entityBlackList, 1) && this.config.entityBlackList.find((e) => e === entity)) {
86
+ this.log.info(`Skipping entity ${CYAN}${entity}${nf} because in entityBlackList`);
87
+ return false;
88
+ }
89
+ if (isValidObject(this.config.deviceEntityBlackList, 1) && device in this.config.deviceEntityBlackList && this.config.deviceEntityBlackList[device].includes(entity)) {
90
+ this.log.info(`Skipping entity ${CYAN}${entity}${wr} for device ${CYAN}${device}${nf} because in deviceEntityBlackList`);
91
+ return false;
92
+ }
93
+ return true;
94
+ }
68
95
  }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "matterbridge",
3
- "version": "1.6.6-dev.2",
3
+ "version": "1.6.6-dev.3",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "matterbridge",
9
- "version": "1.6.6-dev.2",
9
+ "version": "1.6.6-dev.3",
10
10
  "license": "Apache-2.0",
11
11
  "dependencies": {
12
12
  "@matter/main": "0.11.8",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "matterbridge",
3
- "version": "1.6.6-dev.2",
3
+ "version": "1.6.6-dev.3",
4
4
  "description": "Matterbridge plugin manager for Matter",
5
5
  "author": "https://github.com/Luligu",
6
6
  "license": "Apache-2.0",