matterbridge 2.1.5 → 2.1.6-dev.1

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.
Files changed (118) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README-DOCKER.md +17 -7
  3. package/dist/cli.js +0 -26
  4. package/dist/cluster/export.js +0 -2
  5. package/dist/defaultConfigSchema.js +0 -23
  6. package/dist/deviceManager.js +1 -94
  7. package/dist/frontend.js +55 -280
  8. package/dist/index.js +0 -28
  9. package/dist/logger/export.js +0 -1
  10. package/dist/matter/behaviors.js +0 -2
  11. package/dist/matter/clusters.js +0 -2
  12. package/dist/matter/devices.js +0 -2
  13. package/dist/matter/endpoints.js +0 -2
  14. package/dist/matter/export.js +0 -2
  15. package/dist/matter/types.js +0 -2
  16. package/dist/matterbridge.js +68 -765
  17. package/dist/matterbridgeAccessoryPlatform.js +0 -33
  18. package/dist/matterbridgeBehaviors.js +1 -32
  19. package/dist/matterbridgeDeviceTypes.js +11 -112
  20. package/dist/matterbridgeDynamicPlatform.js +0 -33
  21. package/dist/matterbridgeEndpoint.js +6 -690
  22. package/dist/matterbridgeEndpointHelpers.js +9 -117
  23. package/dist/matterbridgePlatform.js +41 -123
  24. package/dist/matterbridgeTypes.js +0 -24
  25. package/dist/pluginManager.js +3 -230
  26. package/dist/storage/export.js +0 -1
  27. package/dist/utils/colorUtils.js +2 -205
  28. package/dist/utils/export.js +0 -1
  29. package/dist/utils/utils.js +10 -264
  30. package/frontend/build/asset-manifest.json +3 -3
  31. package/frontend/build/index.html +1 -1
  32. package/frontend/build/static/js/{main.cd192588.js → main.a241d4f0.js} +9 -9
  33. package/frontend/build/static/js/main.a241d4f0.js.map +1 -0
  34. package/npm-shrinkwrap.json +47 -47
  35. package/package.json +2 -3
  36. package/dist/cli.d.ts +0 -25
  37. package/dist/cli.d.ts.map +0 -1
  38. package/dist/cli.js.map +0 -1
  39. package/dist/cluster/export.d.ts +0 -2
  40. package/dist/cluster/export.d.ts.map +0 -1
  41. package/dist/cluster/export.js.map +0 -1
  42. package/dist/defaultConfigSchema.d.ts +0 -27
  43. package/dist/defaultConfigSchema.d.ts.map +0 -1
  44. package/dist/defaultConfigSchema.js.map +0 -1
  45. package/dist/deviceManager.d.ts +0 -114
  46. package/dist/deviceManager.d.ts.map +0 -1
  47. package/dist/deviceManager.js.map +0 -1
  48. package/dist/frontend.d.ts +0 -143
  49. package/dist/frontend.d.ts.map +0 -1
  50. package/dist/frontend.js.map +0 -1
  51. package/dist/index.d.ts +0 -35
  52. package/dist/index.d.ts.map +0 -1
  53. package/dist/index.js.map +0 -1
  54. package/dist/logger/export.d.ts +0 -2
  55. package/dist/logger/export.d.ts.map +0 -1
  56. package/dist/logger/export.js.map +0 -1
  57. package/dist/matter/behaviors.d.ts +0 -2
  58. package/dist/matter/behaviors.d.ts.map +0 -1
  59. package/dist/matter/behaviors.js.map +0 -1
  60. package/dist/matter/clusters.d.ts +0 -2
  61. package/dist/matter/clusters.d.ts.map +0 -1
  62. package/dist/matter/clusters.js.map +0 -1
  63. package/dist/matter/devices.d.ts +0 -2
  64. package/dist/matter/devices.d.ts.map +0 -1
  65. package/dist/matter/devices.js.map +0 -1
  66. package/dist/matter/endpoints.d.ts +0 -2
  67. package/dist/matter/endpoints.d.ts.map +0 -1
  68. package/dist/matter/endpoints.js.map +0 -1
  69. package/dist/matter/export.d.ts +0 -5
  70. package/dist/matter/export.d.ts.map +0 -1
  71. package/dist/matter/export.js.map +0 -1
  72. package/dist/matter/types.d.ts +0 -3
  73. package/dist/matter/types.d.ts.map +0 -1
  74. package/dist/matter/types.js.map +0 -1
  75. package/dist/matterbridge.d.ts +0 -409
  76. package/dist/matterbridge.d.ts.map +0 -1
  77. package/dist/matterbridge.js.map +0 -1
  78. package/dist/matterbridgeAccessoryPlatform.d.ts +0 -39
  79. package/dist/matterbridgeAccessoryPlatform.d.ts.map +0 -1
  80. package/dist/matterbridgeAccessoryPlatform.js.map +0 -1
  81. package/dist/matterbridgeBehaviors.d.ts +0 -1056
  82. package/dist/matterbridgeBehaviors.d.ts.map +0 -1
  83. package/dist/matterbridgeBehaviors.js.map +0 -1
  84. package/dist/matterbridgeDeviceTypes.d.ts +0 -177
  85. package/dist/matterbridgeDeviceTypes.d.ts.map +0 -1
  86. package/dist/matterbridgeDeviceTypes.js.map +0 -1
  87. package/dist/matterbridgeDynamicPlatform.d.ts +0 -39
  88. package/dist/matterbridgeDynamicPlatform.d.ts.map +0 -1
  89. package/dist/matterbridgeDynamicPlatform.js.map +0 -1
  90. package/dist/matterbridgeEndpoint.d.ts +0 -835
  91. package/dist/matterbridgeEndpoint.d.ts.map +0 -1
  92. package/dist/matterbridgeEndpoint.js.map +0 -1
  93. package/dist/matterbridgeEndpointHelpers.d.ts +0 -2275
  94. package/dist/matterbridgeEndpointHelpers.d.ts.map +0 -1
  95. package/dist/matterbridgeEndpointHelpers.js.map +0 -1
  96. package/dist/matterbridgePlatform.d.ts +0 -159
  97. package/dist/matterbridgePlatform.d.ts.map +0 -1
  98. package/dist/matterbridgePlatform.js.map +0 -1
  99. package/dist/matterbridgeTypes.d.ts +0 -169
  100. package/dist/matterbridgeTypes.d.ts.map +0 -1
  101. package/dist/matterbridgeTypes.js.map +0 -1
  102. package/dist/pluginManager.d.ts +0 -236
  103. package/dist/pluginManager.d.ts.map +0 -1
  104. package/dist/pluginManager.js.map +0 -1
  105. package/dist/storage/export.d.ts +0 -2
  106. package/dist/storage/export.d.ts.map +0 -1
  107. package/dist/storage/export.js.map +0 -1
  108. package/dist/utils/colorUtils.d.ts +0 -61
  109. package/dist/utils/colorUtils.d.ts.map +0 -1
  110. package/dist/utils/colorUtils.js.map +0 -1
  111. package/dist/utils/export.d.ts +0 -3
  112. package/dist/utils/export.d.ts.map +0 -1
  113. package/dist/utils/export.js.map +0 -1
  114. package/dist/utils/utils.d.ts +0 -231
  115. package/dist/utils/utils.d.ts.map +0 -1
  116. package/dist/utils/utils.js.map +0 -1
  117. package/frontend/build/static/js/main.cd192588.js.map +0 -1
  118. /package/frontend/build/static/js/{main.cd192588.js.LICENSE.txt → main.a241d4f0.js.LICENSE.txt} +0 -0
package/CHANGELOG.md CHANGED
@@ -33,6 +33,23 @@ matterbridge-zigbee2mqtt v. 2.4.4
33
33
  matterbridge-somfy-tahoma v. 1.2.3
34
34
  matterbridge-hass v. 0.0.8
35
35
 
36
+ ## [2.1.6] - 2025-02-12
37
+
38
+ ### Added
39
+
40
+ - [docker]: Added health check directly inside the docker image. No need to change configuration.
41
+ - [platform]: Added saving to storage the selects for faster loading.
42
+ - [icon]: Added matterbridge svg icon (thanks: https://github.com/robvanoostenrijk https://github.com/stuntguy3000).
43
+ - [frontend]: Frontend v.2.4.2.
44
+
45
+ ### Changed
46
+
47
+ - [package]: Update matter.js to 0.12.4-alpha.0-20250212-b2729c9eb
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
+
36
53
  ## [2.1.5] - 2025-02-11
37
54
 
38
55
  ### Added
package/README-DOCKER.md CHANGED
@@ -18,6 +18,22 @@
18
18
 
19
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.
20
20
 
21
+ It is based on node:22-bookworm-slim and integrates the health check.
22
+
23
+ How Health Checks Work in Different Scenarios
24
+
25
+ With docker-compose
26
+
27
+ Docker monitors the health check and can restart the container if needed.
28
+
29
+ With docker run
30
+
31
+ The health check still runs in the background, but:
32
+ The container doesn’t restart automatically if it becomes unhealthy.
33
+ You must manually check the health status:
34
+
35
+ docker exec -it matterbridge curl -v http://localhost:8283/health
36
+
21
37
  ### First create the Matterbridge directories
22
38
 
23
39
  This will create the required directories in your home directory if they don't exist
@@ -71,15 +87,9 @@ services:
71
87
  volumes:
72
88
  - "/home/<USER>/Matterbridge:/root/Matterbridge" # Mounts the Matterbridge plugin directory
73
89
  - "/home/<USER>/.matterbridge:/root/.matterbridge" # Mounts the Matterbridge storage directory
74
- healthcheck:
75
- test: curl --fail localhost:8283/health || exit 1
76
- interval: 60s
77
- retries: 5
78
- start_period: 60s
79
- timeout: 10s
80
90
  ```
81
91
 
82
- Replace USER with your user name (i.e. ubuntu or pi).
92
+ Replace USER with your user name (i.e. ubuntu or pi: "/home/ubuntu/Matterbridge:/root/Matterbridge").
83
93
 
84
94
  copy it in the home directory or edit the existing one to add the matterbridge service.
85
95
 
package/dist/cli.js CHANGED
@@ -1,27 +1,4 @@
1
1
  #!/usr/bin/env node
2
- /**
3
- * This file contains the CLI entry point of Matterbridge.
4
- *
5
- * @file cli.ts
6
- * @author Luca Liguori
7
- * @date 2023-12-29
8
- * @version 1.0.11
9
- *
10
- * Copyright 2023, 2024, 2025 Luca Liguori.
11
- *
12
- * Licensed under the Apache License, Version 2.0 (the "License");
13
- * you may not use this file except in compliance with the License.
14
- * You may obtain a copy of the License at
15
- *
16
- * http://www.apache.org/licenses/LICENSE-2.0
17
- *
18
- * Unless required by applicable law or agreed to in writing, software
19
- * distributed under the License is distributed on an "AS IS" BASIS,
20
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
- * See the License for the specific language governing permissions and
22
- * limitations under the License. *
23
- */
24
- /* eslint-disable no-console */
25
2
  import { Matterbridge } from './matterbridge.js';
26
3
  let instance;
27
4
  const cli = '\u001B[32m';
@@ -57,13 +34,10 @@ async function restart() {
57
34
  async function update() {
58
35
  if (process.argv.includes('-debug'))
59
36
  console.log(cli + 'CLI: received update event, updating...' + rs);
60
- // TODO: Implement update logic outside of matterbridge
61
37
  instance = await Matterbridge.loadInstance(true);
62
38
  registerHandlers();
63
39
  }
64
40
  process.title = 'matterbridge';
65
- // Run the main function
66
41
  main().catch((error) => {
67
42
  console.error(er + `CLI: Matterbridge.loadInstance() failed with error: ${error}` + rs);
68
43
  });
69
- //# sourceMappingURL=cli.js.map
@@ -1,3 +1 @@
1
1
  export {};
2
- // Nothing to export right now
3
- //# sourceMappingURL=export.js.map
@@ -1,25 +1,3 @@
1
- /**
2
- * This file contains the default config for the plugins.
3
- *
4
- * @file defaultConfigSchema.ts
5
- * @author Luca Liguori
6
- * @date 2024-05-07
7
- * @version 1.0.1
8
- *
9
- * Copyright 2024, 2025, 2026 Luca Liguori.
10
- *
11
- * Licensed under the Apache License, Version 2.0 (the "License");
12
- * you may not use this file except in compliance with the License.
13
- * You may obtain a copy of the License at
14
- *
15
- * http://www.apache.org/licenses/LICENSE-2.0
16
- *
17
- * Unless required by applicable law or agreed to in writing, software
18
- * distributed under the License is distributed on an "AS IS" BASIS,
19
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
- * See the License for the specific language governing permissions and
21
- * limitations under the License. *
22
- */
23
1
  export const zigbee2mqtt_config = {
24
2
  name: 'matterbridge-zigbee2mqtt',
25
3
  type: 'DynamicPlatform',
@@ -85,4 +63,3 @@ export const shelly_config = {
85
63
  debugWs: false,
86
64
  unregisterOnShutdown: false,
87
65
  };
88
- //# sourceMappingURL=defaultConfigSchema.js.map
@@ -1,89 +1,28 @@
1
- /**
2
- * This file contains the DeviceManager class.
3
- *
4
- * @file devices.ts
5
- * @author Luca Liguori
6
- * @date 2024-07-26
7
- * @version 1.0.9
8
- *
9
- * Copyright 2024, 2025, 2026 Luca Liguori.
10
- *
11
- * Licensed under the Apache License, Version 2.0 (the "License");
12
- * you may not use this file except in compliance with the License.
13
- * You may obtain a copy of the License at
14
- *
15
- * http://www.apache.org/licenses/LICENSE-2.0
16
- *
17
- * Unless required by applicable law or agreed to in writing, software
18
- * distributed under the License is distributed on an "AS IS" BASIS,
19
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
- * See the License for the specific language governing permissions and
21
- * limitations under the License. *
22
- */
23
- // NodeStorage and AnsiLogger modules
24
1
  import { AnsiLogger, BLUE, er } from './logger/export.js';
25
2
  import { dev } from './matterbridgeTypes.js';
26
- /**
27
- * Manages Matterbridge devices.
28
- */
29
3
  export class DeviceManager {
30
4
  _devices = new Map();
31
5
  matterbridge;
32
6
  nodeContext;
33
7
  log;
34
- /**
35
- * Creates an instance of DeviceManager.
36
- *
37
- * @param {Matterbridge} matterbridge - The Matterbridge instance.
38
- * @param {NodeStorage} nodeContext - The node storage context.
39
- */
40
8
  constructor(matterbridge, nodeContext) {
41
9
  this.matterbridge = matterbridge;
42
10
  this.nodeContext = nodeContext;
43
- this.log = new AnsiLogger({ logName: 'DeviceManager', logTimestampFormat: 4 /* TimestampFormat.TIME_MILLIS */, logLevel: matterbridge.log.logLevel });
11
+ this.log = new AnsiLogger({ logName: 'DeviceManager', logTimestampFormat: 4, logLevel: matterbridge.log.logLevel });
44
12
  this.log.debug('Matterbridge device manager starting...');
45
13
  }
46
- /**
47
- * Gets the number of devices.
48
- *
49
- * @returns {number} The number of devices.
50
- */
51
14
  get length() {
52
15
  return this._devices.size;
53
16
  }
54
- /**
55
- * Gets the number of devices.
56
- *
57
- * @returns {number} The number of devices.
58
- */
59
17
  get size() {
60
18
  return this._devices.size;
61
19
  }
62
- /**
63
- * Checks if a device with the specified unique ID exists.
64
- *
65
- * @param {string} uniqueId - The unique ID of the device.
66
- * @returns {boolean} True if the device exists, false otherwise.
67
- */
68
20
  has(uniqueId) {
69
21
  return this._devices.has(uniqueId);
70
22
  }
71
- /**
72
- * Gets a device by its unique ID.
73
- *
74
- * @param {string} uniqueId - The unique ID of the device.
75
- * @returns {MatterbridgeEndpoint | undefined} The device, or undefined if not found.
76
- */
77
23
  get(uniqueId) {
78
24
  return this._devices.get(uniqueId);
79
25
  }
80
- /**
81
- * Adds a device to the manager.
82
- *
83
- * @param {MatterbridgeEndpoint} device - The device to add.
84
- * @returns {MatterbridgeEndpoint} The added device.
85
- * @throws {Error} If the device does not have a unique ID.
86
- */
87
26
  set(device) {
88
27
  if (!device.uniqueId)
89
28
  throw new Error(`The device ${dev}${device.deviceName}${er} has not been initialized: uniqueId is required`);
@@ -92,13 +31,6 @@ export class DeviceManager {
92
31
  this._devices.set(device.uniqueId, device);
93
32
  return device;
94
33
  }
95
- /**
96
- * Removes a device from the manager.
97
- *
98
- * @param {MatterbridgeEndpoint} device - The device to remove.
99
- * @returns {boolean} True if the device was removed, false otherwise.
100
- * @throws {Error} If the device does not have a unique ID.
101
- */
102
34
  remove(device) {
103
35
  if (!device.uniqueId)
104
36
  throw new Error(`The device ${dev}${device.deviceName}${er} has not been initialized: uniqueId is required`);
@@ -106,34 +38,15 @@ export class DeviceManager {
106
38
  this.log.error(`The device ${dev}${device.deviceName}${er} with uniqueId ${BLUE}${device.uniqueId}${er} serialNumber ${BLUE}${device.serialNumber}${er} is not registered in the device manager`);
107
39
  return this._devices.delete(device.uniqueId);
108
40
  }
109
- /**
110
- * Clears all devices from the manager.
111
- */
112
41
  clear() {
113
42
  this._devices.clear();
114
43
  }
115
- /**
116
- * Gets an array of all devices.
117
- *
118
- * @returns {MatterbridgeEndpoint[]} An array of all devices.
119
- */
120
44
  array() {
121
45
  return Array.from(this._devices.values());
122
46
  }
123
- /**
124
- * Iterates over all devices.
125
- *
126
- * @returns {IterableIterator<MatterbridgeEndpoint>} An iterator for the devices.
127
- */
128
47
  [Symbol.iterator]() {
129
48
  return this._devices.values();
130
49
  }
131
- /**
132
- * Asynchronously iterates over each device and calls the provided callback function.
133
- *
134
- * @param {Function} callback - The callback function to call with each device.
135
- * @returns {Promise<void>} A promise that resolves when all callbacks have been called.
136
- */
137
50
  async forEach(callback) {
138
51
  if (this.size === 0)
139
52
  return;
@@ -147,13 +60,7 @@ export class DeviceManager {
147
60
  });
148
61
  await Promise.all(tasks);
149
62
  }
150
- /**
151
- * Sets the log level.
152
- *
153
- * @param {LogLevel} logLevel - The log level to set.
154
- */
155
63
  set logLevel(logLevel) {
156
64
  this.log.logLevel = logLevel;
157
65
  }
158
66
  }
159
- //# sourceMappingURL=deviceManager.js.map