matterbridge 1.6.6-dev.2 → 1.6.6-dev.4

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 required 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">
@@ -702,6 +702,8 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
702
702
  colorTemperatureMireds,
703
703
  colorTempPhysicalMinMireds,
704
704
  colorTempPhysicalMaxMireds,
705
+ coupleColorTempToLevelMinMireds: colorTempPhysicalMinMireds,
706
+ startUpColorTemperatureMireds: null,
705
707
  }, {
706
708
  moveToColor: async (data) => {
707
709
  this.log.debug('Matter command: moveToColor request:', data.request, 'attributes.currentX:', data.attributes.currentX.getLocal(), 'attributes.currentY:', data.attributes.currentY.getLocal());
@@ -841,6 +843,8 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
841
843
  colorTemperatureMireds,
842
844
  colorTempPhysicalMinMireds,
843
845
  colorTempPhysicalMaxMireds,
846
+ coupleColorTempToLevelMinMireds: colorTempPhysicalMinMireds,
847
+ startUpColorTemperatureMireds: null,
844
848
  }, {
845
849
  stopMoveStep: async () => {
846
850
  this.log.error('Matter command: stopMoveStep not implemented');
@@ -1038,6 +1038,8 @@ export class MatterbridgeEndpoint extends Endpoint {
1038
1038
  colorTemperatureMireds,
1039
1039
  colorTempPhysicalMinMireds,
1040
1040
  colorTempPhysicalMaxMireds,
1041
+ coupleColorTempToLevelMinMireds: colorTempPhysicalMinMireds,
1042
+ startUpColorTemperatureMireds: null,
1041
1043
  }, {
1042
1044
  stopMoveStep: async () => {
1043
1045
  },
@@ -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.4",
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.4",
10
10
  "license": "Apache-2.0",
11
11
  "dependencies": {
12
12
  "@matter/main": "0.11.8",
@@ -489,16 +489,15 @@
489
489
  }
490
490
  },
491
491
  "node_modules/call-bind": {
492
- "version": "1.0.7",
493
- "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz",
494
- "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==",
492
+ "version": "1.0.8",
493
+ "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz",
494
+ "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==",
495
495
  "license": "MIT",
496
496
  "dependencies": {
497
+ "call-bind-apply-helpers": "^1.0.0",
497
498
  "es-define-property": "^1.0.0",
498
- "es-errors": "^1.3.0",
499
- "function-bind": "^1.1.2",
500
499
  "get-intrinsic": "^1.2.4",
501
- "set-function-length": "^1.2.1"
500
+ "set-function-length": "^1.2.2"
502
501
  },
503
502
  "engines": {
504
503
  "node": ">= 0.4"
@@ -507,6 +506,19 @@
507
506
  "url": "https://github.com/sponsors/ljharb"
508
507
  }
509
508
  },
509
+ "node_modules/call-bind-apply-helpers": {
510
+ "version": "1.0.0",
511
+ "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.0.tgz",
512
+ "integrity": "sha512-CCKAP2tkPau7D3GE8+V8R6sQubA9R5foIzGp+85EXCVSCivuxBNAWqcpn72PKYiIcqoViv/kcUDpaEIMBVi1lQ==",
513
+ "license": "MIT",
514
+ "dependencies": {
515
+ "es-errors": "^1.3.0",
516
+ "function-bind": "^1.1.2"
517
+ },
518
+ "engines": {
519
+ "node": ">= 0.4"
520
+ }
521
+ },
510
522
  "node_modules/color-convert": {
511
523
  "version": "2.0.1",
512
524
  "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
@@ -1844,10 +1856,13 @@
1844
1856
  }
1845
1857
  },
1846
1858
  "node_modules/text-decoder": {
1847
- "version": "1.2.1",
1848
- "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.1.tgz",
1849
- "integrity": "sha512-x9v3H/lTKIJKQQe7RPQkLfKAnc9lUTkWDypIQgTzPJAq+5/GCDHonmshfvlsNSj58yyshbIJJDLmU15qNERrXQ==",
1850
- "license": "Apache-2.0"
1859
+ "version": "1.2.2",
1860
+ "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.2.tgz",
1861
+ "integrity": "sha512-/MDslo7ZyWTA2vnk1j7XoDVfXsGk3tp+zFEJHJGm0UjIlQifonVFwlVbQDFh8KJzTBnT8ie115TYqir6bclddA==",
1862
+ "license": "Apache-2.0",
1863
+ "dependencies": {
1864
+ "b4a": "^1.6.4"
1865
+ }
1851
1866
  },
1852
1867
  "node_modules/toidentifier": {
1853
1868
  "version": "1.0.1",
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.4",
4
4
  "description": "Matterbridge plugin manager for Matter",
5
5
  "author": "https://github.com/Luligu",
6
6
  "license": "Apache-2.0",