matterbridge 3.2.7 → 3.2.8-dev-20250915-e9a5660

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 (288) hide show
  1. package/CHANGELOG.md +21 -2
  2. package/dist/cli.js +2 -91
  3. package/dist/cliEmitter.js +0 -30
  4. package/dist/clusters/export.js +0 -2
  5. package/dist/defaultConfigSchema.js +0 -24
  6. package/dist/deviceManager.js +1 -94
  7. package/dist/devices/airConditioner.js +0 -57
  8. package/dist/devices/batteryStorage.js +1 -48
  9. package/dist/devices/cooktop.js +0 -55
  10. package/dist/devices/dishwasher.js +0 -57
  11. package/dist/devices/evse.js +10 -74
  12. package/dist/devices/export.js +0 -5
  13. package/dist/devices/extractorHood.js +0 -42
  14. package/dist/devices/heatPump.js +2 -50
  15. package/dist/devices/laundryDryer.js +3 -62
  16. package/dist/devices/laundryWasher.js +4 -70
  17. package/dist/devices/microwaveOven.js +5 -88
  18. package/dist/devices/oven.js +0 -85
  19. package/dist/devices/refrigerator.js +0 -102
  20. package/dist/devices/roboticVacuumCleaner.js +9 -100
  21. package/dist/devices/solarPower.js +0 -38
  22. package/dist/devices/speaker.js +0 -84
  23. package/dist/devices/temperatureControl.js +3 -25
  24. package/dist/devices/waterHeater.js +2 -82
  25. package/dist/dgram/coap.js +13 -126
  26. package/dist/dgram/dgram.js +2 -114
  27. package/dist/dgram/mb_coap.js +3 -41
  28. package/dist/dgram/mb_mdns.js +15 -80
  29. package/dist/dgram/mdns.js +137 -299
  30. package/dist/dgram/multicast.js +1 -62
  31. package/dist/dgram/unicast.js +0 -54
  32. package/dist/frontend.js +33 -458
  33. package/dist/globalMatterbridge.js +0 -47
  34. package/dist/helpers.js +0 -53
  35. package/dist/index.js +1 -30
  36. package/dist/logger/export.js +0 -1
  37. package/dist/matter/behaviors.js +0 -2
  38. package/dist/matter/clusters.js +0 -2
  39. package/dist/matter/devices.js +0 -2
  40. package/dist/matter/endpoints.js +0 -2
  41. package/dist/matter/export.js +0 -3
  42. package/dist/matter/types.js +0 -3
  43. package/dist/matterbridge.js +53 -789
  44. package/dist/matterbridgeAccessoryPlatform.js +0 -36
  45. package/dist/matterbridgeBehaviors.js +5 -65
  46. package/dist/matterbridgeDeviceTypes.js +17 -630
  47. package/dist/matterbridgeDynamicPlatform.js +0 -36
  48. package/dist/matterbridgeEndpoint.js +55 -1373
  49. package/dist/matterbridgeEndpointHelpers.js +12 -345
  50. package/dist/matterbridgePlatform.js +0 -304
  51. package/dist/matterbridgeTypes.js +0 -25
  52. package/dist/pluginManager.js +3 -249
  53. package/dist/shelly.js +7 -168
  54. package/dist/storage/export.js +0 -1
  55. package/dist/update.js +0 -69
  56. package/dist/utils/colorUtils.js +2 -97
  57. package/dist/utils/commandLine.js +0 -54
  58. package/dist/utils/copyDirectory.js +1 -38
  59. package/dist/utils/createDirectory.js +0 -33
  60. package/dist/utils/createZip.js +2 -47
  61. package/dist/utils/deepCopy.js +0 -39
  62. package/dist/utils/deepEqual.js +1 -72
  63. package/dist/utils/error.js +0 -41
  64. package/dist/utils/export.js +0 -1
  65. package/dist/utils/hex.js +0 -124
  66. package/dist/utils/isvalid.js +0 -101
  67. package/dist/utils/jestHelpers.js +3 -153
  68. package/dist/utils/network.js +5 -91
  69. package/dist/utils/spawn.js +0 -40
  70. package/dist/utils/wait.js +8 -60
  71. package/frontend/build/asset-manifest.json +6 -6
  72. package/frontend/build/index.html +1 -1
  73. package/frontend/build/static/css/{main.a2f4846a.css → main.56c16a87.css} +2 -2
  74. package/frontend/build/static/css/main.56c16a87.css.map +1 -0
  75. package/frontend/build/static/js/{main.ee68a4ae.js → main.25c57952.js} +3 -3
  76. package/frontend/build/static/js/{main.ee68a4ae.js.map → main.25c57952.js.map} +1 -1
  77. package/frontend/package.json +1 -1
  78. package/npm-shrinkwrap.json +5 -5
  79. package/package.json +1 -2
  80. package/dist/cli.d.ts +0 -26
  81. package/dist/cli.d.ts.map +0 -1
  82. package/dist/cli.js.map +0 -1
  83. package/dist/cliEmitter.d.ts +0 -34
  84. package/dist/cliEmitter.d.ts.map +0 -1
  85. package/dist/cliEmitter.js.map +0 -1
  86. package/dist/clusters/export.d.ts +0 -2
  87. package/dist/clusters/export.d.ts.map +0 -1
  88. package/dist/clusters/export.js.map +0 -1
  89. package/dist/defaultConfigSchema.d.ts +0 -28
  90. package/dist/defaultConfigSchema.d.ts.map +0 -1
  91. package/dist/defaultConfigSchema.js.map +0 -1
  92. package/dist/deviceManager.d.ts +0 -112
  93. package/dist/deviceManager.d.ts.map +0 -1
  94. package/dist/deviceManager.js.map +0 -1
  95. package/dist/devices/airConditioner.d.ts +0 -98
  96. package/dist/devices/airConditioner.d.ts.map +0 -1
  97. package/dist/devices/airConditioner.js.map +0 -1
  98. package/dist/devices/batteryStorage.d.ts +0 -48
  99. package/dist/devices/batteryStorage.d.ts.map +0 -1
  100. package/dist/devices/batteryStorage.js.map +0 -1
  101. package/dist/devices/cooktop.d.ts +0 -60
  102. package/dist/devices/cooktop.d.ts.map +0 -1
  103. package/dist/devices/cooktop.js.map +0 -1
  104. package/dist/devices/dishwasher.d.ts +0 -71
  105. package/dist/devices/dishwasher.d.ts.map +0 -1
  106. package/dist/devices/dishwasher.js.map +0 -1
  107. package/dist/devices/evse.d.ts +0 -75
  108. package/dist/devices/evse.d.ts.map +0 -1
  109. package/dist/devices/evse.js.map +0 -1
  110. package/dist/devices/export.d.ts +0 -17
  111. package/dist/devices/export.d.ts.map +0 -1
  112. package/dist/devices/export.js.map +0 -1
  113. package/dist/devices/extractorHood.d.ts +0 -46
  114. package/dist/devices/extractorHood.d.ts.map +0 -1
  115. package/dist/devices/extractorHood.js.map +0 -1
  116. package/dist/devices/heatPump.d.ts +0 -47
  117. package/dist/devices/heatPump.d.ts.map +0 -1
  118. package/dist/devices/heatPump.js.map +0 -1
  119. package/dist/devices/laundryDryer.d.ts +0 -67
  120. package/dist/devices/laundryDryer.d.ts.map +0 -1
  121. package/dist/devices/laundryDryer.js.map +0 -1
  122. package/dist/devices/laundryWasher.d.ts +0 -81
  123. package/dist/devices/laundryWasher.d.ts.map +0 -1
  124. package/dist/devices/laundryWasher.js.map +0 -1
  125. package/dist/devices/microwaveOven.d.ts +0 -168
  126. package/dist/devices/microwaveOven.d.ts.map +0 -1
  127. package/dist/devices/microwaveOven.js.map +0 -1
  128. package/dist/devices/oven.d.ts +0 -105
  129. package/dist/devices/oven.d.ts.map +0 -1
  130. package/dist/devices/oven.js.map +0 -1
  131. package/dist/devices/refrigerator.d.ts +0 -118
  132. package/dist/devices/refrigerator.d.ts.map +0 -1
  133. package/dist/devices/refrigerator.js.map +0 -1
  134. package/dist/devices/roboticVacuumCleaner.d.ts +0 -112
  135. package/dist/devices/roboticVacuumCleaner.d.ts.map +0 -1
  136. package/dist/devices/roboticVacuumCleaner.js.map +0 -1
  137. package/dist/devices/solarPower.d.ts +0 -40
  138. package/dist/devices/solarPower.d.ts.map +0 -1
  139. package/dist/devices/solarPower.js.map +0 -1
  140. package/dist/devices/speaker.d.ts +0 -87
  141. package/dist/devices/speaker.d.ts.map +0 -1
  142. package/dist/devices/speaker.js.map +0 -1
  143. package/dist/devices/temperatureControl.d.ts +0 -166
  144. package/dist/devices/temperatureControl.d.ts.map +0 -1
  145. package/dist/devices/temperatureControl.js.map +0 -1
  146. package/dist/devices/waterHeater.d.ts +0 -111
  147. package/dist/devices/waterHeater.d.ts.map +0 -1
  148. package/dist/devices/waterHeater.js.map +0 -1
  149. package/dist/dgram/coap.d.ts +0 -205
  150. package/dist/dgram/coap.d.ts.map +0 -1
  151. package/dist/dgram/coap.js.map +0 -1
  152. package/dist/dgram/dgram.d.ts +0 -141
  153. package/dist/dgram/dgram.d.ts.map +0 -1
  154. package/dist/dgram/dgram.js.map +0 -1
  155. package/dist/dgram/mb_coap.d.ts +0 -24
  156. package/dist/dgram/mb_coap.d.ts.map +0 -1
  157. package/dist/dgram/mb_coap.js.map +0 -1
  158. package/dist/dgram/mb_mdns.d.ts +0 -24
  159. package/dist/dgram/mb_mdns.d.ts.map +0 -1
  160. package/dist/dgram/mb_mdns.js.map +0 -1
  161. package/dist/dgram/mdns.d.ts +0 -290
  162. package/dist/dgram/mdns.d.ts.map +0 -1
  163. package/dist/dgram/mdns.js.map +0 -1
  164. package/dist/dgram/multicast.d.ts +0 -67
  165. package/dist/dgram/multicast.d.ts.map +0 -1
  166. package/dist/dgram/multicast.js.map +0 -1
  167. package/dist/dgram/unicast.d.ts +0 -56
  168. package/dist/dgram/unicast.d.ts.map +0 -1
  169. package/dist/dgram/unicast.js.map +0 -1
  170. package/dist/frontend.d.ts +0 -315
  171. package/dist/frontend.d.ts.map +0 -1
  172. package/dist/frontend.js.map +0 -1
  173. package/dist/globalMatterbridge.d.ts +0 -59
  174. package/dist/globalMatterbridge.d.ts.map +0 -1
  175. package/dist/globalMatterbridge.js.map +0 -1
  176. package/dist/helpers.d.ts +0 -48
  177. package/dist/helpers.d.ts.map +0 -1
  178. package/dist/helpers.js.map +0 -1
  179. package/dist/index.d.ts +0 -33
  180. package/dist/index.d.ts.map +0 -1
  181. package/dist/index.js.map +0 -1
  182. package/dist/logger/export.d.ts +0 -2
  183. package/dist/logger/export.d.ts.map +0 -1
  184. package/dist/logger/export.js.map +0 -1
  185. package/dist/matter/behaviors.d.ts +0 -2
  186. package/dist/matter/behaviors.d.ts.map +0 -1
  187. package/dist/matter/behaviors.js.map +0 -1
  188. package/dist/matter/clusters.d.ts +0 -2
  189. package/dist/matter/clusters.d.ts.map +0 -1
  190. package/dist/matter/clusters.js.map +0 -1
  191. package/dist/matter/devices.d.ts +0 -2
  192. package/dist/matter/devices.d.ts.map +0 -1
  193. package/dist/matter/devices.js.map +0 -1
  194. package/dist/matter/endpoints.d.ts +0 -2
  195. package/dist/matter/endpoints.d.ts.map +0 -1
  196. package/dist/matter/endpoints.js.map +0 -1
  197. package/dist/matter/export.d.ts +0 -5
  198. package/dist/matter/export.d.ts.map +0 -1
  199. package/dist/matter/export.js.map +0 -1
  200. package/dist/matter/types.d.ts +0 -3
  201. package/dist/matter/types.d.ts.map +0 -1
  202. package/dist/matter/types.js.map +0 -1
  203. package/dist/matterbridge.d.ts +0 -465
  204. package/dist/matterbridge.d.ts.map +0 -1
  205. package/dist/matterbridge.js.map +0 -1
  206. package/dist/matterbridgeAccessoryPlatform.d.ts +0 -42
  207. package/dist/matterbridgeAccessoryPlatform.d.ts.map +0 -1
  208. package/dist/matterbridgeAccessoryPlatform.js.map +0 -1
  209. package/dist/matterbridgeBehaviors.d.ts +0 -1747
  210. package/dist/matterbridgeBehaviors.d.ts.map +0 -1
  211. package/dist/matterbridgeBehaviors.js.map +0 -1
  212. package/dist/matterbridgeDeviceTypes.d.ts +0 -761
  213. package/dist/matterbridgeDeviceTypes.d.ts.map +0 -1
  214. package/dist/matterbridgeDeviceTypes.js.map +0 -1
  215. package/dist/matterbridgeDynamicPlatform.d.ts +0 -42
  216. package/dist/matterbridgeDynamicPlatform.d.ts.map +0 -1
  217. package/dist/matterbridgeDynamicPlatform.js.map +0 -1
  218. package/dist/matterbridgeEndpoint.d.ts +0 -1515
  219. package/dist/matterbridgeEndpoint.d.ts.map +0 -1
  220. package/dist/matterbridgeEndpoint.js.map +0 -1
  221. package/dist/matterbridgeEndpointHelpers.d.ts +0 -407
  222. package/dist/matterbridgeEndpointHelpers.d.ts.map +0 -1
  223. package/dist/matterbridgeEndpointHelpers.js.map +0 -1
  224. package/dist/matterbridgePlatform.d.ts +0 -380
  225. package/dist/matterbridgePlatform.d.ts.map +0 -1
  226. package/dist/matterbridgePlatform.js.map +0 -1
  227. package/dist/matterbridgeTypes.d.ts +0 -204
  228. package/dist/matterbridgeTypes.d.ts.map +0 -1
  229. package/dist/matterbridgeTypes.js.map +0 -1
  230. package/dist/pluginManager.d.ts +0 -270
  231. package/dist/pluginManager.d.ts.map +0 -1
  232. package/dist/pluginManager.js.map +0 -1
  233. package/dist/shelly.d.ts +0 -174
  234. package/dist/shelly.d.ts.map +0 -1
  235. package/dist/shelly.js.map +0 -1
  236. package/dist/storage/export.d.ts +0 -2
  237. package/dist/storage/export.d.ts.map +0 -1
  238. package/dist/storage/export.js.map +0 -1
  239. package/dist/update.d.ts +0 -75
  240. package/dist/update.d.ts.map +0 -1
  241. package/dist/update.js.map +0 -1
  242. package/dist/utils/colorUtils.d.ts +0 -99
  243. package/dist/utils/colorUtils.d.ts.map +0 -1
  244. package/dist/utils/colorUtils.js.map +0 -1
  245. package/dist/utils/commandLine.d.ts +0 -59
  246. package/dist/utils/commandLine.d.ts.map +0 -1
  247. package/dist/utils/commandLine.js.map +0 -1
  248. package/dist/utils/copyDirectory.d.ts +0 -33
  249. package/dist/utils/copyDirectory.d.ts.map +0 -1
  250. package/dist/utils/copyDirectory.js.map +0 -1
  251. package/dist/utils/createDirectory.d.ts +0 -34
  252. package/dist/utils/createDirectory.d.ts.map +0 -1
  253. package/dist/utils/createDirectory.js.map +0 -1
  254. package/dist/utils/createZip.d.ts +0 -39
  255. package/dist/utils/createZip.d.ts.map +0 -1
  256. package/dist/utils/createZip.js.map +0 -1
  257. package/dist/utils/deepCopy.d.ts +0 -32
  258. package/dist/utils/deepCopy.d.ts.map +0 -1
  259. package/dist/utils/deepCopy.js.map +0 -1
  260. package/dist/utils/deepEqual.d.ts +0 -54
  261. package/dist/utils/deepEqual.d.ts.map +0 -1
  262. package/dist/utils/deepEqual.js.map +0 -1
  263. package/dist/utils/error.d.ts +0 -44
  264. package/dist/utils/error.d.ts.map +0 -1
  265. package/dist/utils/error.js.map +0 -1
  266. package/dist/utils/export.d.ts +0 -13
  267. package/dist/utils/export.d.ts.map +0 -1
  268. package/dist/utils/export.js.map +0 -1
  269. package/dist/utils/hex.d.ts +0 -89
  270. package/dist/utils/hex.d.ts.map +0 -1
  271. package/dist/utils/hex.js.map +0 -1
  272. package/dist/utils/isvalid.d.ts +0 -103
  273. package/dist/utils/isvalid.d.ts.map +0 -1
  274. package/dist/utils/isvalid.js.map +0 -1
  275. package/dist/utils/jestHelpers.d.ts +0 -137
  276. package/dist/utils/jestHelpers.d.ts.map +0 -1
  277. package/dist/utils/jestHelpers.js.map +0 -1
  278. package/dist/utils/network.d.ts +0 -84
  279. package/dist/utils/network.d.ts.map +0 -1
  280. package/dist/utils/network.js.map +0 -1
  281. package/dist/utils/spawn.d.ts +0 -33
  282. package/dist/utils/spawn.d.ts.map +0 -1
  283. package/dist/utils/spawn.js.map +0 -1
  284. package/dist/utils/wait.d.ts +0 -54
  285. package/dist/utils/wait.d.ts.map +0 -1
  286. package/dist/utils/wait.js.map +0 -1
  287. package/frontend/build/static/css/main.a2f4846a.css.map +0 -1
  288. /package/frontend/build/static/js/{main.ee68a4ae.js.LICENSE.txt → main.25c57952.js.LICENSE.txt} +0 -0
@@ -1,70 +1,23 @@
1
- /**
2
- * This file contains functions to set and get global instances of Matterbridge, Frontend, and Logger.
3
- *
4
- * @file globalMatterbridge.ts
5
- * @author Luca Liguori
6
- * @created 2025-06-01
7
- * @version 1.0.0
8
- * @license Apache-2.0
9
- *
10
- * Copyright 2025, 2026, 2027 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
- /**
25
- * Store the Matterbridge instance globally for later retrieval.
26
- *
27
- * @param {Matterbridge} matterbridge An initialized Matterbridge instance
28
- */
29
1
  export function setGlobalMatterbridge(matterbridge) {
30
2
  globalThis.__matterbridge__ = matterbridge;
31
3
  globalThis.__frontend__ = matterbridge.frontend;
32
4
  globalThis.__log__ = matterbridge.log;
33
5
  }
34
- /**
35
- * Retrieve the globally stored Matterbridge instance.
36
- *
37
- * @returns {Matterbridge} The Matterbridge instance.
38
- * @throws {Error} If the Matterbridge instance is not set.
39
- */
40
6
  export function getGlobalMatterbridge() {
41
7
  if (!globalThis.__matterbridge__) {
42
8
  throw new Error('Global Matterbridge instance is not set.');
43
9
  }
44
10
  return globalThis.__matterbridge__;
45
11
  }
46
- /**
47
- * Retrieve the globally stored Frontend instance.
48
- *
49
- * @returns {Frontend} The Frontend instance.
50
- * @throws {Error} If the Frontend instance is not set.
51
- */
52
12
  export function getGlobalFrontend() {
53
13
  if (!globalThis.__frontend__) {
54
14
  throw new Error('Global Frontend instance is not set.');
55
15
  }
56
16
  return globalThis.__frontend__;
57
17
  }
58
- /**
59
- * Retrieve the globally stored Logger instance.
60
- *
61
- * @returns {AnsiLogger} The AnsiLogger instance.
62
- * @throws {Error} If the Logger instance is not set.
63
- */
64
18
  export function getGlobalLog() {
65
19
  if (!globalThis.__log__) {
66
20
  throw new Error('Global Logger instance is not set.');
67
21
  }
68
22
  return globalThis.__log__;
69
23
  }
70
- //# sourceMappingURL=globalMatterbridge.js.map
package/dist/helpers.js CHANGED
@@ -1,27 +1,3 @@
1
- /**
2
- * This file contains the helpers functions of Matterbridge.
3
- *
4
- * @file helpers.ts
5
- * @author Luca Liguori
6
- * @created 2025-05-12
7
- * @version 1.0.0
8
- * @license Apache-2.0
9
- *
10
- * Copyright 2025, 2026, 2027 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
- // @matter module
25
1
  import { OnOff } from '@matter/main/clusters/on-off';
26
2
  import { Endpoint } from '@matter/node';
27
3
  import { BridgedDeviceBasicInformationServer } from '@matter/node/behaviors/bridged-device-basic-information';
@@ -30,24 +6,8 @@ import { OnOffPlugInUnitDevice } from '@matter/node/devices/on-off-plug-in-unit'
30
6
  import { MountedOnOffControlDevice } from '@matter/node/devices/mounted-on-off-control';
31
7
  import { OnOffLightDevice } from '@matter/node/devices/on-off-light';
32
8
  import { OnOffLightSwitchDevice } from '@matter/node/devices/on-off-light-switch';
33
- // Matterbridge
34
9
  import { hasParameter } from './utils/commandLine.js';
35
- /**
36
- * Adds a virtual device to the provided endpoint, sets up an event listener for device state changes,
37
- * and ensures the device is initialized in the off state.
38
- *
39
- * @param {Endpoint<AggregatorEndpoint>} aggregatorEndpoint - The aggragator endpoint to which the virtual device will be added.
40
- * @param {string} name - The name of the virtual device. Spaces in the name are removed to form the device ID.
41
- * @param {'light' | 'outlet' | 'switch' | 'mounted_switch'} type - The type of the virtual device. Can be 'light', 'outlet', 'switch', or 'mounted_switch'.
42
- * @param {() => Promise<void>} callback - A callback function that gets executed when the device's on/off state changes to true.
43
- * @returns {Promise<Endpoint>} A promise that resolves with the created virtual device.
44
- * @remarks The virtual device is created as an instance of `Endpoint` with the `OnOffPlugInUnitDevice` device type.
45
- * The onOff state always reverts to false when the device is turned on.
46
- */
47
10
  export async function addVirtualDevice(aggregatorEndpoint, name, type, callback) {
48
- // Create a new virtual device by instantiating `Endpoint` with device information.
49
- // The device ID is created by replacing all spaces in the name with an empty string.
50
- // The node label of the bridged device basic information is set to the given name.
51
11
  let deviceType;
52
12
  switch (type) {
53
13
  case 'light':
@@ -68,9 +28,7 @@ export async function addVirtualDevice(aggregatorEndpoint, name, type, callback)
68
28
  bridgedDeviceBasicInformation: { nodeLabel: name.slice(0, 32) },
69
29
  onOff: { onOff: false, startUpOnOff: OnOff.StartUpOnOff.Off },
70
30
  });
71
- // Set up an event listener for when the `onOff` state changes.
72
31
  device.events.onOff.onOff$Changed.on((value) => {
73
- // If the `onOff` state becomes true, turn off the virtual device and execute the callback.
74
32
  if (value) {
75
33
  callback();
76
34
  process.nextTick(async () => {
@@ -78,24 +36,14 @@ export async function addVirtualDevice(aggregatorEndpoint, name, type, callback)
78
36
  await device.setStateOf(OnOffBaseServer, { onOff: false });
79
37
  }
80
38
  catch (_error) {
81
- // Not necessary to handle the error
82
39
  }
83
40
  });
84
41
  }
85
42
  });
86
- // Add the created device to the given endpoint.
87
43
  await aggregatorEndpoint.add(device);
88
- // Initially set the state of the virtual device's `OnOffBaseServer` to false (off).
89
44
  await device.setStateOf(OnOffBaseServer, { onOff: false });
90
45
  return device;
91
46
  }
92
- /**
93
- * Creates and add the virtual devices to the aggregator.
94
- *
95
- * @param {Matterbridge} matterbridge - The Matterbridge instance.
96
- * @param {Endpoint<AggregatorEndpoint>} aggregatorEndpoint - The aggregator node to add the virtual devices to.
97
- * @returns {Promise<void>} A promise that resolves when the virtual devices are added.
98
- */
99
47
  export async function addVirtualDevices(matterbridge, aggregatorEndpoint) {
100
48
  if (matterbridge.matterbridgeInformation.virtualMode !== 'disabled' && matterbridge.bridgeMode === 'bridge' && aggregatorEndpoint) {
101
49
  matterbridge.log.notice(`Creating virtual devices for Matterbridge server node...`);
@@ -144,4 +92,3 @@ export async function addVirtualDevices(matterbridge, aggregatorEndpoint) {
144
92
  }
145
93
  }
146
94
  }
147
- //# sourceMappingURL=helpers.js.map
package/dist/index.js CHANGED
@@ -1,31 +1,6 @@
1
- /**
2
- * @description This file contains the entry point of Matterbridge.
3
- * @file index.ts
4
- * @author Luca Liguori
5
- * @created 2023-12-29
6
- * @version 1.0.7
7
- * @license Apache-2.0
8
- *
9
- * Copyright 2023, 2024, 2025 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
- // AnsiLogger module
24
1
  import { AnsiLogger } from 'node-ansi-logger';
25
- // Matterbridge
26
2
  import { Matterbridge } from './matterbridge.js';
27
3
  import { hasParameter } from './utils/export.js';
28
- // Matterbridge
29
4
  export * from './matterbridge.js';
30
5
  export * from './matterbridgeTypes.js';
31
6
  export * from './matterbridgeEndpoint.js';
@@ -36,10 +11,7 @@ export * from './matterbridgePlatform.js';
36
11
  export * from './matterbridgeAccessoryPlatform.js';
37
12
  export * from './matterbridgeDynamicPlatform.js';
38
13
  export { addVirtualDevice } from './helpers.js';
39
- const log = new AnsiLogger({ logName: 'Main', logTimestampFormat: 4 /* TimestampFormat.TIME_MILLIS */, logLevel: hasParameter('debug') ? "debug" /* LogLevel.DEBUG */ : "info" /* LogLevel.INFO */ });
40
- /**
41
- * Main function to load the Matterbridge instance.
42
- */
14
+ const log = new AnsiLogger({ logName: 'Main', logTimestampFormat: 4, logLevel: hasParameter('debug') ? "debug" : "info" });
43
15
  async function main() {
44
16
  log.debug('***Matterbridge.loadInstance() called');
45
17
  await Matterbridge.loadInstance();
@@ -48,4 +20,3 @@ async function main() {
48
20
  main().catch((error) => {
49
21
  log.error(`Matterbridge.loadInstance() failed with error: ${error instanceof Error ? error.message : error}`);
50
22
  });
51
- //# sourceMappingURL=index.js.map
@@ -1,2 +1 @@
1
1
  export * from 'node-ansi-logger';
2
- //# sourceMappingURL=export.js.map
@@ -1,3 +1 @@
1
- // @matter
2
1
  export * from '@matter/node/behaviors';
3
- //# sourceMappingURL=behaviors.js.map
@@ -1,3 +1 @@
1
- // @matter
2
1
  export * from '@matter/types/clusters';
3
- //# sourceMappingURL=clusters.js.map
@@ -1,3 +1 @@
1
- // @matter
2
1
  export * from '@matter/node/devices';
3
- //# sourceMappingURL=devices.js.map
@@ -1,3 +1 @@
1
- // @matter
2
1
  export { AggregatorEndpoint, ElectricalSensorEndpoint, PowerSourceEndpoint, BridgedNodeEndpoint, RootEndpoint, DeviceEnergyManagementEndpoint, OtaProviderEndpoint, OtaRequestorEndpoint } from '@matter/node/endpoints';
3
- //# sourceMappingURL=endpoints.js.map
@@ -1,7 +1,4 @@
1
- /* eslint-disable import/export */
2
- // @matter
3
1
  export * from '@matter/main';
4
2
  export { SemanticNamespace, ClosureTag, CompassDirectionTag, CompassLocationTag, DirectionTag, ElectricalMeasurementTag, LaundryTag, LevelTag, LocationTag, NumberTag, PositionTag, PowerSourceTag, RefrigeratorTag, RoomAirConditionerTag, SwitchesTag, } from '@matter/main';
5
3
  export { AttributeElement, ClusterElement, ClusterModel, CommandElement, EventElement, FieldElement } from '@matter/main/model';
6
4
  export { MdnsService, Val } from '@matter/main/protocol';
7
- //# sourceMappingURL=export.js.map
@@ -1,5 +1,2 @@
1
- /* eslint-disable import/export */
2
- // @matter
3
1
  export * from '@matter/types';
4
2
  export { ClusterRegistry } from '@matter/types';
5
- //# sourceMappingURL=types.js.map