matterbridge 2.1.5-dev.8 → 2.1.5

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 (112) hide show
  1. package/CHANGELOG.md +4 -2
  2. package/README-DOCKER.md +6 -0
  3. package/dist/cli.d.ts +25 -0
  4. package/dist/cli.d.ts.map +1 -0
  5. package/dist/cli.js +26 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/cluster/export.d.ts +2 -0
  8. package/dist/cluster/export.d.ts.map +1 -0
  9. package/dist/cluster/export.js +2 -0
  10. package/dist/cluster/export.js.map +1 -0
  11. package/dist/defaultConfigSchema.d.ts +27 -0
  12. package/dist/defaultConfigSchema.d.ts.map +1 -0
  13. package/dist/defaultConfigSchema.js +23 -0
  14. package/dist/defaultConfigSchema.js.map +1 -0
  15. package/dist/deviceManager.d.ts +114 -0
  16. package/dist/deviceManager.d.ts.map +1 -0
  17. package/dist/deviceManager.js +94 -1
  18. package/dist/deviceManager.js.map +1 -0
  19. package/dist/frontend.d.ts +143 -0
  20. package/dist/frontend.d.ts.map +1 -0
  21. package/dist/frontend.js +268 -28
  22. package/dist/frontend.js.map +1 -0
  23. package/dist/index.d.ts +35 -0
  24. package/dist/index.d.ts.map +1 -0
  25. package/dist/index.js +28 -0
  26. package/dist/index.js.map +1 -0
  27. package/dist/logger/export.d.ts +2 -0
  28. package/dist/logger/export.d.ts.map +1 -0
  29. package/dist/logger/export.js +1 -0
  30. package/dist/logger/export.js.map +1 -0
  31. package/dist/matter/behaviors.d.ts +2 -0
  32. package/dist/matter/behaviors.d.ts.map +1 -0
  33. package/dist/matter/behaviors.js +2 -0
  34. package/dist/matter/behaviors.js.map +1 -0
  35. package/dist/matter/clusters.d.ts +2 -0
  36. package/dist/matter/clusters.d.ts.map +1 -0
  37. package/dist/matter/clusters.js +2 -0
  38. package/dist/matter/clusters.js.map +1 -0
  39. package/dist/matter/devices.d.ts +2 -0
  40. package/dist/matter/devices.d.ts.map +1 -0
  41. package/dist/matter/devices.js +2 -0
  42. package/dist/matter/devices.js.map +1 -0
  43. package/dist/matter/endpoints.d.ts +2 -0
  44. package/dist/matter/endpoints.d.ts.map +1 -0
  45. package/dist/matter/endpoints.js +2 -0
  46. package/dist/matter/endpoints.js.map +1 -0
  47. package/dist/matter/export.d.ts +5 -0
  48. package/dist/matter/export.d.ts.map +1 -0
  49. package/dist/matter/export.js +2 -0
  50. package/dist/matter/export.js.map +1 -0
  51. package/dist/matter/types.d.ts +3 -0
  52. package/dist/matter/types.d.ts.map +1 -0
  53. package/dist/matter/types.js +2 -0
  54. package/dist/matter/types.js.map +1 -0
  55. package/dist/matterbridge.d.ts +409 -0
  56. package/dist/matterbridge.d.ts.map +1 -0
  57. package/dist/matterbridge.js +748 -41
  58. package/dist/matterbridge.js.map +1 -0
  59. package/dist/matterbridgeAccessoryPlatform.d.ts +39 -0
  60. package/dist/matterbridgeAccessoryPlatform.d.ts.map +1 -0
  61. package/dist/matterbridgeAccessoryPlatform.js +33 -0
  62. package/dist/matterbridgeAccessoryPlatform.js.map +1 -0
  63. package/dist/matterbridgeBehaviors.d.ts +1056 -0
  64. package/dist/matterbridgeBehaviors.d.ts.map +1 -0
  65. package/dist/matterbridgeBehaviors.js +32 -1
  66. package/dist/matterbridgeBehaviors.js.map +1 -0
  67. package/dist/matterbridgeDeviceTypes.d.ts +177 -0
  68. package/dist/matterbridgeDeviceTypes.d.ts.map +1 -0
  69. package/dist/matterbridgeDeviceTypes.js +112 -11
  70. package/dist/matterbridgeDeviceTypes.js.map +1 -0
  71. package/dist/matterbridgeDynamicPlatform.d.ts +39 -0
  72. package/dist/matterbridgeDynamicPlatform.d.ts.map +1 -0
  73. package/dist/matterbridgeDynamicPlatform.js +33 -0
  74. package/dist/matterbridgeDynamicPlatform.js.map +1 -0
  75. package/dist/matterbridgeEndpoint.d.ts +835 -0
  76. package/dist/matterbridgeEndpoint.d.ts.map +1 -0
  77. package/dist/matterbridgeEndpoint.js +690 -6
  78. package/dist/matterbridgeEndpoint.js.map +1 -0
  79. package/dist/matterbridgeEndpointHelpers.d.ts +2275 -0
  80. package/dist/matterbridgeEndpointHelpers.d.ts.map +1 -0
  81. package/dist/matterbridgeEndpointHelpers.js +117 -9
  82. package/dist/matterbridgeEndpointHelpers.js.map +1 -0
  83. package/dist/matterbridgePlatform.d.ts +159 -0
  84. package/dist/matterbridgePlatform.d.ts.map +1 -0
  85. package/dist/matterbridgePlatform.js +121 -5
  86. package/dist/matterbridgePlatform.js.map +1 -0
  87. package/dist/matterbridgeTypes.d.ts +169 -0
  88. package/dist/matterbridgeTypes.d.ts.map +1 -0
  89. package/dist/matterbridgeTypes.js +24 -0
  90. package/dist/matterbridgeTypes.js.map +1 -0
  91. package/dist/pluginManager.d.ts +236 -0
  92. package/dist/pluginManager.d.ts.map +1 -0
  93. package/dist/pluginManager.js +230 -3
  94. package/dist/pluginManager.js.map +1 -0
  95. package/dist/storage/export.d.ts +2 -0
  96. package/dist/storage/export.d.ts.map +1 -0
  97. package/dist/storage/export.js +1 -0
  98. package/dist/storage/export.js.map +1 -0
  99. package/dist/utils/colorUtils.d.ts +61 -0
  100. package/dist/utils/colorUtils.d.ts.map +1 -0
  101. package/dist/utils/colorUtils.js +205 -2
  102. package/dist/utils/colorUtils.js.map +1 -0
  103. package/dist/utils/export.d.ts +3 -0
  104. package/dist/utils/export.d.ts.map +1 -0
  105. package/dist/utils/export.js +1 -0
  106. package/dist/utils/export.js.map +1 -0
  107. package/dist/utils/utils.d.ts +231 -0
  108. package/dist/utils/utils.d.ts.map +1 -0
  109. package/dist/utils/utils.js +264 -10
  110. package/dist/utils/utils.js.map +1 -0
  111. package/npm-shrinkwrap.json +2 -2
  112. package/package.json +2 -1
package/CHANGELOG.md CHANGED
@@ -33,7 +33,7 @@ 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.5] - 2025-02-10
36
+ ## [2.1.5] - 2025-02-11
37
37
 
38
38
  ### Added
39
39
 
@@ -42,15 +42,17 @@ matterbridge-hass v. 0.0.8
42
42
  - [frontend]: Added cpuUsed, rss and heapUsed to SystemInformation.
43
43
  - [frontend]: Added UiProvider.
44
44
  - [frontend]: Added wssSendCpuUpdate, wssSendMemoryUpdate and wssSendSnackbarMessage.
45
+ - [docker]: Added health check to docker images. See README-DOCKER.md with the updated configuration.
45
46
 
46
47
  ### Changed
47
48
 
48
- - [matterbridge]: Calls getNpmPackageVersion() instead of npm to get latest version.
49
+ - [matterbridge]: Calls getNpmPackageVersion() instead of npm to get latest version to optimize memory and cpu usage.
49
50
  - [matterbridge]: Memory optimization on MatterbridgeEndpoint.
50
51
 
51
52
  ### Fixed
52
53
 
53
54
  - [matterbridge]: Refactor shutdown sequences for reset and factory reset.
55
+ - [matterbridge]: Refactor reset devices adding a wait of 1 sec to allow matter to deliver all messages before shutting down.
54
56
 
55
57
  <a href="https://www.buymeacoffee.com/luligugithub">
56
58
  <img src="./yellow-button.png" alt="Buy me a coffee" width="120">
package/README-DOCKER.md CHANGED
@@ -71,6 +71,12 @@ services:
71
71
  volumes:
72
72
  - "/home/<USER>/Matterbridge:/root/Matterbridge" # Mounts the Matterbridge plugin directory
73
73
  - "/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
74
80
  ```
75
81
 
76
82
  Replace USER with your user name (i.e. ubuntu or pi).
package/dist/cli.d.ts ADDED
@@ -0,0 +1,25 @@
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
+ export {};
25
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;GAqBG"}
package/dist/cli.js CHANGED
@@ -1,4 +1,27 @@
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 */
2
25
  import { Matterbridge } from './matterbridge.js';
3
26
  let instance;
4
27
  const cli = '\u001B[32m';
@@ -34,10 +57,13 @@ async function restart() {
34
57
  async function update() {
35
58
  if (process.argv.includes('-debug'))
36
59
  console.log(cli + 'CLI: received update event, updating...' + rs);
60
+ // TODO: Implement update logic outside of matterbridge
37
61
  instance = await Matterbridge.loadInstance(true);
38
62
  registerHandlers();
39
63
  }
40
64
  process.title = 'matterbridge';
65
+ // Run the main function
41
66
  main().catch((error) => {
42
67
  console.error(er + `CLI: Matterbridge.loadInstance() failed with error: ${error}` + rs);
43
68
  });
69
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,+BAA+B;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,IAAI,QAAkC,CAAC;AACvC,MAAM,GAAG,GAAG,YAAY,CAAC;AACzB,MAAM,EAAE,GAAG,gBAAgB,CAAC;AAC5B,MAAM,EAAE,GAAG,cAAc,CAAC;AAE1B,KAAK,UAAU,IAAI;IACjB,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,QAAQ,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,cAAc,wBAAwB,GAAG,EAAE,CAAC,CAAC;IAClK,QAAQ,GAAG,MAAM,YAAY,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IACjD,gBAAgB,EAAE,CAAC;IACnB,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,QAAQ,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,cAAc,wBAAwB,GAAG,EAAE,CAAC,CAAC;AACpK,CAAC;AAED,SAAS,gBAAgB;IACvB,IAAI,QAAQ;QAAE,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC9D,IAAI,QAAQ;Q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@
1
+ export {};
2
+ //# sourceMappingURL=export.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../src/cluster/export.ts"],"names":[],"mappings":""}
@@ -1 +1,3 @@
1
1
  export {};
2
+ // Nothing to export right now
3
+ //# sourceMappingURL=export.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export.js","sourceRoot":"","sources":["../../src/cluster/export.ts"],"names":[],"mappings":";AAAA,8BAA8B"}
@@ -0,0 +1,27 @@
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
+ import { PlatformConfig } from './matterbridgePlatform.js';
24
+ export declare const zigbee2mqtt_config: PlatformConfig;
25
+ export declare const somfytahoma_config: PlatformConfig;
26
+ export declare const shelly_config: PlatformConfig;
27
+ //# sourceMappingURL=defaultConfigSchema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultConfigSchema.d.ts","sourceRoot":"","sources":["../src/defaultConfigSchema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,eAAO,MAAM,kBAAkB,EAAE,cAiBhC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,cAWhC,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,cAkC3B,CAAC"}
@@ -1,3 +1,25 @@
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
+ */
1
23
  export const zigbee2mqtt_config = {
2
24
  name: 'matterbridge-zigbee2mqtt',
3
25
  type: 'DynamicPlatform',
@@ -63,3 +85,4 @@ export const shelly_config = {
63
85
  debugWs: false,
64
86
  unregisterOnShutdown: false,
65
87
  };
88
+ //# sourceMappingURL=defaultConfigSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultConfigSchema.js","sourceRoot":"","sources":["../src/defaultConfigSchema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,MAAM,CAAC,MAAM,kBAAkB,GAAmB;IAChD,IAAI,EAAE,0BAA0B;IAChC,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE,WAAW;IACjB,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,aAAa;IACpB,SAAS,EAAE,EAAE;IACb,SAAS,EAAE,EAAE;IACb,UAAU,EAAE,EAAE;IACd,SAAS,EAAE,EAAE;IACb,UAAU,EAAE,EAAE;IACd,gBAAgB,EAAE,EAAE;IACpB,sBAAsB,EAAE,EA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E,KAAK;CAC5B,CAAC"}
@@ -0,0 +1,114 @@
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
+ import { LogLevel } from './logger/export.js';
24
+ import { NodeStorage } from './storage/export.js';
25
+ import { Matterbridge } from './matterbridge.js';
26
+ import { MatterbridgeEndpoint } from './matterbridgeEndpoint.js';
27
+ /**
28
+ * Manages Matterbridge devices.
29
+ */
30
+ export declare class DeviceManager {
31
+ private readonly _devices;
32
+ private readonly matterbridge;
33
+ private readonly nodeContext;
34
+ private readonly log;
35
+ /**
36
+ * Creates an instance of DeviceManager.
37
+ *
38
+ * @param {Matterbridge} matterbridge - The Matterbridge instance.
39
+ * @param {NodeStorage} nodeContext - The node storage context.
40
+ */
41
+ constructor(matterbridge: Matterbridge, nodeContext: NodeStorage);
42
+ /**
43
+ * Gets the number of devices.
44
+ *
45
+ * @returns {number} The number of devices.
46
+ */
47
+ get length(): number;
48
+ /**
49
+ * Gets the number of devices.
50
+ *
51
+ * @returns {number} The number of devices.
52
+ */
53
+ get size(): number;
54
+ /**
55
+ * Checks if a device with the specified unique ID exists.
56
+ *
57
+ * @param {string} uniqueId - The unique ID of the device.
58
+ * @returns {boolean} True if the device exists, false otherwise.
59
+ */
60
+ has(uniqueId: string): boolean;
61
+ /**
62
+ * Gets a device by its unique ID.
63
+ *
64
+ * @param {string} uniqueId - The unique ID of the device.
65
+ * @returns {MatterbridgeEndpoint | undefined} The device, or undefined if not found.
66
+ */
67
+ get(uniqueId: string): MatterbridgeEndpoint | undefined;
68
+ /**
69
+ * Adds a device to the manager.
70
+ *
71
+ * @param {MatterbridgeEndpoint} device - The device to add.
72
+ * @returns {MatterbridgeEndpoint} The added device.
73
+ * @throws {Error} If the device does not have a unique ID.
74
+ */
75
+ set(device: MatterbridgeEndpoint): MatterbridgeEndpoint;
76
+ /**
77
+ * Removes a device from the manager.
78
+ *
79
+ * @param {MatterbridgeEndpoint} device - The device to remove.
80
+ * @returns {boolean} True if the device was removed, false otherwise.
81
+ * @throws {Error} If the device does not have a unique ID.
82
+ */
83
+ remove(device: MatterbridgeEndpoint): boolean;
84
+ /**
85
+ * Clears all devices from the manager.
86
+ */
87
+ clear(): void;
88
+ /**
89
+ * Gets an array of all devices.
90
+ *
91
+ * @returns {MatterbridgeEndpoint[]} An array of all devices.
92
+ */
93
+ array(): MatterbridgeEndpoint[];
94
+ /**
95
+ * Iterates over all devices.
96
+ *
97
+ * @returns {IterableIterator<MatterbridgeEndpoint>} An iterator for the devices.
98
+ */
99
+ [Symbol.iterator](): MapIterator<MatterbridgeEndpoint>;
100
+ /**
101
+ * Asynchronously iterates over each device and calls the provided callback function.
102
+ *
103
+ * @param {Function} callback - The callback function to call with each device.
104
+ * @returns {Promise<void>} A promise that resolves when all callbacks have been called.
105
+ */
106
+ forEach(callback: (device: MatterbridgeEndpoint) => Promise<void>): Promise<void>;
107
+ /**
108
+ * Sets the log level.
109
+ *
110
+ * @param {LogLevel} logLevel - The log level to set.
111
+ */
112
+ set logLevel(logLevel: LogLevel);
113
+ }
114
+ //# sourceMappingURL=deviceManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deviceManager.d.ts","sourceRoot":"","sources":["../src/deviceManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAAwB,Q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* 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
1
24
  import { AnsiLogger, BLUE, er } from './logger/export.js';
2
25
  import { dev } from './matterbridgeTypes.js';
26
+ /**
27
+ * Manages Matterbridge devices.
28
+ */
3
29
  export class DeviceManager {
4
30
  _devices = new Map();
5
31
  matterbridge;
6
32
  nodeContext;
7
33
  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
+ */
8
40
  constructor(matterbridge, nodeContext) {
9
41
  this.matterbridge = matterbridge;
10
42
  this.nodeContext = nodeContext;
11
- this.log = new AnsiLogger({ logName: 'DeviceManager', logTimestampFormat: 4, logLevel: matterbridge.log.logLevel });
43
+ this.log = new AnsiLogger({ logName: 'DeviceManager', logTimestampFormat: 4 /* TimestampFormat.TIME_MILLIS */, logLevel: matterbridge.log.logLevel });
12
44
  this.log.debug('Matterbridge device manager starting...');
13
45
  }
46
+ /**
47
+ * Gets the number of devices.
48
+ *
49
+ * @returns {number} The number of devices.
50
+ */
14
51
  get length() {
15
52
  return this._devices.size;
16
53
  }
54
+ /**
55
+ * Gets the number of devices.
56
+ *
57
+ * @returns {number} The number of devices.
58
+ */
17
59
  get size() {
18
60
  return this._devices.size;
19
61
  }
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
+ */
20
68
  has(uniqueId) {
21
69
  return this._devices.has(uniqueId);
22
70
  }
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
+ */
23
77
  get(uniqueId) {
24
78
  return this._devices.get(uniqueId);
25
79
  }
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
+ */
26
87
  set(device) {
27
88
  if (!device.uniqueId)
28
89
  throw new Error(`The device ${dev}${device.deviceName}${er} has not been initialized: uniqueId is required`);
@@ -31,6 +92,13 @@ export class DeviceManager {
31
92
  this._devices.set(device.uniqueId, device);
32
93
  return device;
33
94
  }
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
+ */
34
102
  remove(device) {
35
103
  if (!device.uniqueId)
36
104
  throw new Error(`The device ${dev}${device.deviceName}${er} has not been initialized: uniqueId is required`);
@@ -38,15 +106,34 @@ export class DeviceManager {
38
106
  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`);
39
107
  return this._devices.delete(device.uniqueId);
40
108
  }
109
+ /**
110
+ * Clears all devices from the manager.
111
+ */
41
112
  clear() {
42
113
  this._devices.clear();
43
114
  }
115
+ /**
116
+ * Gets an array of all devices.
117
+ *
118
+ * @returns {MatterbridgeEndpoint[]} An array of all devices.
119
+ */
44
120
  array() {
45
121
  return Array.from(this._devices.values());
46
122
  }
123
+ /**
124
+ * Iterates over all devices.
125
+ *
126
+ * @returns {IterableIterator<MatterbridgeEndpoint>} An iterator for the devices.
127
+ */
47
128
  [Symbol.iterator]() {
48
129
  return this._devices.values();
49
130
  }
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
+ */
50
137
  async forEach(callback) {
51
138
  if (this.size === 0)
52
139
  return;
@@ -60,7 +147,13 @@ export class DeviceManager {
60
147
  });
61
148
  await Promise.all(tasks);
62
149
  }
150
+ /**
151
+ * Sets the log level.
152
+ *
153
+ * @param {LogLevel} logLevel - The log level to set.
154
+ */
63
155
  set logLevel(logLevel) {
64
156
  this.log.logLevel = logLevel;
65
157
  }
66
158
  }
159
+ //# sourceMappingURL=deviceManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deviceManager.js","sourceRoot":"","sources":["../src/deviceManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,qCAAqC;AACrC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,EAA6B,MAAM,oBAAoB,CAAC;AAMrF,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAE7C;;GAEG;AACH,MAAM,OAAO,aAAa;IACP,QAAQ,GAAG,IAAI,GAAG,EAAgC,CAAC;IACnD,YAAY,CAAe;IAC3B,WAAW,CAAc;IACzB,GAAG,CAAa;IAEjC;;;;;OAKG;IACH,YAAY,YAA0B,EAAE,WAAwB;QAC9D,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,GAAG,GAAG,IAAI,UAAU,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,kBAAkB,qCAA6B,EAAE,QAAQ,EAAE,Y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,EAAE,iBAAiB,IAAI,GAAG,MAAM,CAAC,YAAY,GAAG,EAAE,cAAc,IAAI,GAAG,MAAM,CAAC,QAAQ,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;YACrL,CAAC;QACH,CAAC,CAAC,CAAC;QACH,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACH,IAAI,QAAQ,CAAC,QAAkB;QAC7B,IAAI,CAAC,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC/B,CAAC;CACF"}
@@ -0,0 +1,143 @@
1
+ /**
2
+ * This file contains the class Frontend.
3
+ *
4
+ * @file frontend.ts
5
+ * @author Luca Liguori
6
+ * @date 2025-01-13
7
+ * @version 1.0.2
8
+ *
9
+ * Copyright 2025, 2026, 2027 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
+ import { LogLevel } from './logger/export.js';
24
+ import { Matterbridge } from './matterbridge.js';
25
+ /**
26
+ * Websocket message ID for logging.
27
+ * @constant {number}
28
+ */
29
+ export declare const WS_ID_LOG = 0;
30
+ /**
31
+ * Websocket message ID indicating a refresh is needed.
32
+ * @constant {number}
33
+ */
34
+ export declare const WS_ID_REFRESH_NEEDED = 1;
35
+ /**
36
+ * Websocket message ID indicating a restart is needed.
37
+ * @constant {number}
38
+ */
39
+ export declare const WS_ID_RESTART_NEEDED = 2;
40
+ /**
41
+ * Websocket message ID indicating a cpu update.
42
+ * @constant {number}
43
+ */
44
+ export declare const WS_ID_CPU_UPDATE = 3;
45
+ /**
46
+ * Websocket message ID indicating a memory update.
47
+ * @constant {number}
48
+ */
49
+ export declare const WS_ID_MEMORY_UPDATE = 4;
50
+ /**
51
+ * Websocket message ID indicating a memory update.
52
+ * @constant {number}
53
+ */
54
+ export declare const WS_ID_SNACKBAR = 5;
55
+ /**
56
+ * Initializes the frontend of Matterbridge.
57
+ *
58
+ * @param port The port number to run the frontend server on. Default is 8283.
59
+ */
60
+ export declare class Frontend {
61
+ private matterbridge;
62
+ private log;
63
+ private port;
64
+ private initializeError;
65
+ private expressApp;
66
+ private httpServer;
67
+ private httpsServer;
68
+ private webSocketServer;
69
+ private prevCpus;
70
+ private lastCpuUsage;
71
+ private memoryData;
72
+ private memoryInterval?;
73
+ private memoryTimeout?;
74
+ constructor(matterbridge: Matterbridge);
75
+ set logLevel(logLevel: LogLevel);
76
+ start(port?: number): Promise<void>;
77
+ stop(): Promise<void>;
78
+ private formatMemoryUsage;
79
+ private formatOsUpTime;
80
+ private getCpuUsage;
81
+ private startCpuMemoryDump;
82
+ private stopCpuMemoryDump;
83
+ /**
84
+ * Retrieves the api settings data.
85
+ * @returns {Promise<object>} A promise that resolve in the api settings object.
86
+ */
87
+ private getApiSettings;
88
+ /**
89
+ * Retrieves the cluster text description from a given device.
90
+ * @param {MatterbridgeDevice} device - The MatterbridgeDevice object.
91
+ * @returns {string} The attributes description of the cluster servers in the device.
92
+ */
93
+ private getClusterTextFromDevice;
94
+ /**
95
+ * Retrieves the base registered plugins sanitized for res.json().
96
+ * @returns {BaseRegisteredPlugin[]} An array of BaseRegisteredPlugin.
97
+ */
98
+ private getBaseRegisteredPlugins;
99
+ /**
100
+ * Handles incoming websocket messages for the Matterbridge.
101
+ *
102
+ * @param {Matterbridge} this - The Matterbridge instance.
103
+ * @param {WebSocket} client - The websocket client that sent the message.
104
+ * @param {WebSocket.RawData} message - The raw data of the message received from the client.
105
+ * @returns {Promise<void>} A promise that resolves when the message has been handled.
106
+ */
107
+ private wsMessageHandler;
108
+ /**
109
+ * Sends a WebSocket message to all connected clients. The function is called by AnsiLogger.setGlobalCallback.
110
+ *
111
+ * @param {string} level - The logger level of the message: debug info notice warn error fatal...
112
+ * @param {string} time - The time string of the message
113
+ * @param {string} name - The logger name of the message
114
+ * @param {string} message - The content of the message.
115
+ */
116
+ wssSendMessage(level: string, time: string, name: string, message: string): void;
117
+ /**
118
+ * Sends a need to refresh WebSocket message to all connected clients.
119
+ *
120
+ */
121
+ wssSendRefreshRequired(): void;
122
+ /**
123
+ * Sends a need to restart WebSocket message to all connected clients.
124
+ *
125
+ */
126
+ wssSendRestartRequired(): void;
127
+ /**
128
+ * Sends a memory update message to all connected clients.
129
+ *
130
+ */
131
+ wssSendCpuUpdate(cpuUsed: string): void;
132
+ /**
133
+ * Sends a cpu update message to all connected clients.
134
+ *
135
+ */
136
+ wssSendMemoryUpdate(freeMemory: string, totalMemory: string, systemUptime: string, rss: string, heapUsed: string, heapTotal: string): void;
137
+ /**
138
+ * Sends a cpu update message to all connected clients.
139
+ *
140
+ */
141
+ wssSendSnackbarMessage(message: string, timeout?: number): void;
142
+ }
143
+ //# sourceMappingURL=frontend.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontend.d.ts","sourceRoot":"","sources":["../src/frontend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAeH,OAAO,EAA4C,QAAQ,EAA2E,MAAM,oBAAoB,CAAC;AAKjK,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD;;;GAGG;AACH,eAAO,MAAM,SAAS,IAAI,CAAC;AAE3B;;;GAGG;AACH,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC;;;GAGG;AACH,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC;;;GAGG;AACH,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC;;;GAGG;AACH,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC;;;GAGG;AACH,eAAO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