@matterbridge/core 3.5.3 → 3.5.4-dev-20260211-520e349

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 (294) hide show
  1. package/README.md +1 -1
  2. package/dist/cli.d.ts +0 -24
  3. package/dist/cli.js +1 -97
  4. package/dist/cliEmitter.d.ts +0 -36
  5. package/dist/cliEmitter.js +0 -37
  6. package/dist/cliHistory.d.ts +0 -42
  7. package/dist/cliHistory.js +0 -38
  8. package/dist/clusters/export.d.ts +0 -1
  9. package/dist/clusters/export.js +0 -2
  10. package/dist/deviceManager.d.ts +0 -108
  11. package/dist/deviceManager.js +1 -114
  12. package/dist/devices/airConditioner.d.ts +0 -75
  13. package/dist/devices/airConditioner.js +0 -57
  14. package/dist/devices/basicVideoPlayer.d.ts +0 -58
  15. package/dist/devices/basicVideoPlayer.js +1 -56
  16. package/dist/devices/batteryStorage.d.ts +0 -43
  17. package/dist/devices/batteryStorage.js +1 -48
  18. package/dist/devices/castingVideoPlayer.d.ts +0 -63
  19. package/dist/devices/castingVideoPlayer.js +2 -65
  20. package/dist/devices/cooktop.d.ts +0 -55
  21. package/dist/devices/cooktop.js +0 -56
  22. package/dist/devices/dishwasher.d.ts +0 -55
  23. package/dist/devices/dishwasher.js +0 -57
  24. package/dist/devices/evse.d.ts +0 -57
  25. package/dist/devices/evse.js +10 -74
  26. package/dist/devices/export.d.ts +0 -1
  27. package/dist/devices/export.js +0 -5
  28. package/dist/devices/extractorHood.d.ts +0 -41
  29. package/dist/devices/extractorHood.js +0 -43
  30. package/dist/devices/heatPump.d.ts +0 -43
  31. package/dist/devices/heatPump.js +2 -50
  32. package/dist/devices/laundryDryer.d.ts +0 -58
  33. package/dist/devices/laundryDryer.js +3 -62
  34. package/dist/devices/laundryWasher.d.ts +0 -64
  35. package/dist/devices/laundryWasher.js +4 -70
  36. package/dist/devices/microwaveOven.d.ts +1 -77
  37. package/dist/devices/microwaveOven.js +5 -88
  38. package/dist/devices/oven.d.ts +0 -82
  39. package/dist/devices/oven.js +0 -85
  40. package/dist/devices/refrigerator.d.ts +0 -100
  41. package/dist/devices/refrigerator.js +0 -102
  42. package/dist/devices/roboticVacuumCleaner.d.ts +0 -83
  43. package/dist/devices/roboticVacuumCleaner.js +9 -100
  44. package/dist/devices/solarPower.d.ts +0 -36
  45. package/dist/devices/solarPower.js +0 -38
  46. package/dist/devices/speaker.d.ts +0 -79
  47. package/dist/devices/speaker.js +0 -84
  48. package/dist/devices/temperatureControl.d.ts +0 -21
  49. package/dist/devices/temperatureControl.js +3 -24
  50. package/dist/devices/waterHeater.d.ts +0 -74
  51. package/dist/devices/waterHeater.js +2 -82
  52. package/dist/dgram/export.d.ts +0 -1
  53. package/dist/dgram/export.js +0 -1
  54. package/dist/export.d.ts +0 -23
  55. package/dist/export.js +0 -28
  56. package/dist/frontend.d.ts +0 -187
  57. package/dist/frontend.js +62 -581
  58. package/dist/helpers.d.ts +0 -43
  59. package/dist/helpers.js +0 -86
  60. package/dist/jestutils/export.d.ts +0 -1
  61. package/dist/jestutils/export.js +0 -1
  62. package/dist/jestutils/jestHelpers.d.ts +0 -259
  63. package/dist/jestutils/jestHelpers.js +15 -396
  64. package/dist/matter/behaviors.d.ts +0 -1
  65. package/dist/matter/behaviors.js +0 -2
  66. package/dist/matter/clusters.d.ts +0 -1
  67. package/dist/matter/clusters.js +0 -2
  68. package/dist/matter/devices.d.ts +0 -1
  69. package/dist/matter/devices.js +0 -2
  70. package/dist/matter/endpoints.d.ts +0 -1
  71. package/dist/matter/endpoints.js +0 -2
  72. package/dist/matter/export.d.ts +0 -1
  73. package/dist/matter/export.js +0 -2
  74. package/dist/matter/types.d.ts +0 -1
  75. package/dist/matter/types.js +0 -2
  76. package/dist/matterNode.d.ts +0 -258
  77. package/dist/matterNode.js +8 -356
  78. package/dist/matterbridge.d.ts +0 -389
  79. package/dist/matterbridge.js +48 -878
  80. package/dist/matterbridgeAccessoryPlatform.d.ts +0 -42
  81. package/dist/matterbridgeAccessoryPlatform.js +0 -50
  82. package/dist/matterbridgeBehaviors.d.ts +0 -24
  83. package/dist/matterbridgeBehaviors.js +5 -65
  84. package/dist/matterbridgeDeviceTypes.d.ts +0 -649
  85. package/dist/matterbridgeDeviceTypes.js +6 -673
  86. package/dist/matterbridgeDynamicPlatform.d.ts +0 -42
  87. package/dist/matterbridgeDynamicPlatform.js +0 -50
  88. package/dist/matterbridgeEndpoint.d.ts +0 -1369
  89. package/dist/matterbridgeEndpoint.js +56 -1514
  90. package/dist/matterbridgeEndpointHelpers.d.ts +0 -425
  91. package/dist/matterbridgeEndpointHelpers.js +20 -483
  92. package/dist/matterbridgeEndpointTypes.d.ts +0 -70
  93. package/dist/matterbridgeEndpointTypes.js +0 -25
  94. package/dist/matterbridgePlatform.d.ts +0 -434
  95. package/dist/matterbridgePlatform.js +1 -473
  96. package/dist/pluginManager.d.ts +0 -307
  97. package/dist/pluginManager.js +6 -346
  98. package/dist/spawn.d.ts +0 -32
  99. package/dist/spawn.js +1 -71
  100. package/dist/utils/export.d.ts +0 -1
  101. package/dist/utils/export.js +0 -1
  102. package/package.json +27 -6
  103. package/dist/cli.d.ts.map +0 -1
  104. package/dist/cli.js.map +0 -1
  105. package/dist/cliEmitter.d.ts.map +0 -1
  106. package/dist/cliEmitter.js.map +0 -1
  107. package/dist/cliHistory.d.ts.map +0 -1
  108. package/dist/cliHistory.js.map +0 -1
  109. package/dist/clusters/export.d.ts.map +0 -1
  110. package/dist/clusters/export.js.map +0 -1
  111. package/dist/crypto/attestationDecoder.d.ts +0 -180
  112. package/dist/crypto/attestationDecoder.d.ts.map +0 -1
  113. package/dist/crypto/attestationDecoder.js +0 -176
  114. package/dist/crypto/attestationDecoder.js.map +0 -1
  115. package/dist/crypto/declarationDecoder.d.ts +0 -72
  116. package/dist/crypto/declarationDecoder.d.ts.map +0 -1
  117. package/dist/crypto/declarationDecoder.js +0 -241
  118. package/dist/crypto/declarationDecoder.js.map +0 -1
  119. package/dist/crypto/extract/342/200/220cert/342/200/220extensions.d.ts +0 -9
  120. package/dist/crypto/extract/342/200/220cert/342/200/220extensions.d.ts.map +0 -1
  121. package/dist/crypto/extract/342/200/220cert/342/200/220extensions.js +0 -120
  122. package/dist/crypto/extract/342/200/220cert/342/200/220extensions.js.map +0 -1
  123. package/dist/crypto/read-extensions.d.ts +0 -2
  124. package/dist/crypto/read-extensions.d.ts.map +0 -1
  125. package/dist/crypto/read-extensions.js +0 -81
  126. package/dist/crypto/read-extensions.js.map +0 -1
  127. package/dist/crypto/testData.d.ts +0 -31
  128. package/dist/crypto/testData.d.ts.map +0 -1
  129. package/dist/crypto/testData.js +0 -131
  130. package/dist/crypto/testData.js.map +0 -1
  131. package/dist/crypto/walk-der.d.ts +0 -2
  132. package/dist/crypto/walk-der.d.ts.map +0 -1
  133. package/dist/crypto/walk-der.js +0 -165
  134. package/dist/crypto/walk-der.js.map +0 -1
  135. package/dist/deviceManager.d.ts.map +0 -1
  136. package/dist/deviceManager.js.map +0 -1
  137. package/dist/devices/airConditioner.d.ts.map +0 -1
  138. package/dist/devices/airConditioner.js.map +0 -1
  139. package/dist/devices/basicVideoPlayer.d.ts.map +0 -1
  140. package/dist/devices/basicVideoPlayer.js.map +0 -1
  141. package/dist/devices/batteryStorage.d.ts.map +0 -1
  142. package/dist/devices/batteryStorage.js.map +0 -1
  143. package/dist/devices/castingVideoPlayer.d.ts.map +0 -1
  144. package/dist/devices/castingVideoPlayer.js.map +0 -1
  145. package/dist/devices/cooktop.d.ts.map +0 -1
  146. package/dist/devices/cooktop.js.map +0 -1
  147. package/dist/devices/dishwasher.d.ts.map +0 -1
  148. package/dist/devices/dishwasher.js.map +0 -1
  149. package/dist/devices/evse.d.ts.map +0 -1
  150. package/dist/devices/evse.js.map +0 -1
  151. package/dist/devices/export.d.ts.map +0 -1
  152. package/dist/devices/export.js.map +0 -1
  153. package/dist/devices/extractorHood.d.ts.map +0 -1
  154. package/dist/devices/extractorHood.js.map +0 -1
  155. package/dist/devices/heatPump.d.ts.map +0 -1
  156. package/dist/devices/heatPump.js.map +0 -1
  157. package/dist/devices/laundryDryer.d.ts.map +0 -1
  158. package/dist/devices/laundryDryer.js.map +0 -1
  159. package/dist/devices/laundryWasher.d.ts.map +0 -1
  160. package/dist/devices/laundryWasher.js.map +0 -1
  161. package/dist/devices/microwaveOven.d.ts.map +0 -1
  162. package/dist/devices/microwaveOven.js.map +0 -1
  163. package/dist/devices/oven.d.ts.map +0 -1
  164. package/dist/devices/oven.js.map +0 -1
  165. package/dist/devices/refrigerator.d.ts.map +0 -1
  166. package/dist/devices/refrigerator.js.map +0 -1
  167. package/dist/devices/roboticVacuumCleaner.d.ts.map +0 -1
  168. package/dist/devices/roboticVacuumCleaner.js.map +0 -1
  169. package/dist/devices/solarPower.d.ts.map +0 -1
  170. package/dist/devices/solarPower.js.map +0 -1
  171. package/dist/devices/speaker.d.ts.map +0 -1
  172. package/dist/devices/speaker.js.map +0 -1
  173. package/dist/devices/temperatureControl.d.ts.map +0 -1
  174. package/dist/devices/temperatureControl.js.map +0 -1
  175. package/dist/devices/waterHeater.d.ts.map +0 -1
  176. package/dist/devices/waterHeater.js.map +0 -1
  177. package/dist/dgram/export.d.ts.map +0 -1
  178. package/dist/dgram/export.js.map +0 -1
  179. package/dist/export.d.ts.map +0 -1
  180. package/dist/export.js.map +0 -1
  181. package/dist/frontend.d.ts.map +0 -1
  182. package/dist/frontend.js.map +0 -1
  183. package/dist/helpers.d.ts.map +0 -1
  184. package/dist/helpers.js.map +0 -1
  185. package/dist/jestutils/export.d.ts.map +0 -1
  186. package/dist/jestutils/export.js.map +0 -1
  187. package/dist/jestutils/jestHelpers.d.ts.map +0 -1
  188. package/dist/jestutils/jestHelpers.js.map +0 -1
  189. package/dist/matter/behaviors.d.ts.map +0 -1
  190. package/dist/matter/behaviors.js.map +0 -1
  191. package/dist/matter/clusters.d.ts.map +0 -1
  192. package/dist/matter/clusters.js.map +0 -1
  193. package/dist/matter/devices.d.ts.map +0 -1
  194. package/dist/matter/devices.js.map +0 -1
  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.map +0 -1
  198. package/dist/matter/export.js.map +0 -1
  199. package/dist/matter/types.d.ts.map +0 -1
  200. package/dist/matter/types.js.map +0 -1
  201. package/dist/matterNode.d.ts.map +0 -1
  202. package/dist/matterNode.js.map +0 -1
  203. package/dist/matterbridge.d.ts.map +0 -1
  204. package/dist/matterbridge.js.map +0 -1
  205. package/dist/matterbridgeAccessoryPlatform.d.ts.map +0 -1
  206. package/dist/matterbridgeAccessoryPlatform.js.map +0 -1
  207. package/dist/matterbridgeBehaviors.d.ts.map +0 -1
  208. package/dist/matterbridgeBehaviors.js.map +0 -1
  209. package/dist/matterbridgeDeviceTypes.d.ts.map +0 -1
  210. package/dist/matterbridgeDeviceTypes.js.map +0 -1
  211. package/dist/matterbridgeDynamicPlatform.d.ts.map +0 -1
  212. package/dist/matterbridgeDynamicPlatform.js.map +0 -1
  213. package/dist/matterbridgeEndpoint.d.ts.map +0 -1
  214. package/dist/matterbridgeEndpoint.js.map +0 -1
  215. package/dist/matterbridgeEndpointHelpers.d.ts.map +0 -1
  216. package/dist/matterbridgeEndpointHelpers.js.map +0 -1
  217. package/dist/matterbridgeEndpointTypes.d.ts.map +0 -1
  218. package/dist/matterbridgeEndpointTypes.js.map +0 -1
  219. package/dist/matterbridgePlatform.d.ts.map +0 -1
  220. package/dist/matterbridgePlatform.js.map +0 -1
  221. package/dist/mb_coap.d.ts +0 -24
  222. package/dist/mb_coap.d.ts.map +0 -1
  223. package/dist/mb_coap.js +0 -89
  224. package/dist/mb_coap.js.map +0 -1
  225. package/dist/mb_health.d.ts +0 -77
  226. package/dist/mb_health.d.ts.map +0 -1
  227. package/dist/mb_health.js +0 -147
  228. package/dist/mb_health.js.map +0 -1
  229. package/dist/mb_mdns.d.ts +0 -24
  230. package/dist/mb_mdns.d.ts.map +0 -1
  231. package/dist/mb_mdns.js +0 -285
  232. package/dist/mb_mdns.js.map +0 -1
  233. package/dist/pluginManager.d.ts.map +0 -1
  234. package/dist/pluginManager.js.map +0 -1
  235. package/dist/spawn.d.ts.map +0 -1
  236. package/dist/spawn.js.map +0 -1
  237. package/dist/utils/export.d.ts.map +0 -1
  238. package/dist/utils/export.js.map +0 -1
  239. package/dist/workers/brand.d.ts +0 -25
  240. package/dist/workers/brand.d.ts.map +0 -1
  241. package/dist/workers/brand.extend.d.ts +0 -10
  242. package/dist/workers/brand.extend.d.ts.map +0 -1
  243. package/dist/workers/brand.extend.js +0 -15
  244. package/dist/workers/brand.extend.js.map +0 -1
  245. package/dist/workers/brand.invalid.d.ts +0 -9
  246. package/dist/workers/brand.invalid.d.ts.map +0 -1
  247. package/dist/workers/brand.invalid.js +0 -19
  248. package/dist/workers/brand.invalid.js.map +0 -1
  249. package/dist/workers/brand.js +0 -67
  250. package/dist/workers/brand.js.map +0 -1
  251. package/dist/workers/clusterTypes.d.ts +0 -47
  252. package/dist/workers/clusterTypes.d.ts.map +0 -1
  253. package/dist/workers/clusterTypes.js +0 -57
  254. package/dist/workers/clusterTypes.js.map +0 -1
  255. package/dist/workers/frontendWorker.d.ts +0 -2
  256. package/dist/workers/frontendWorker.d.ts.map +0 -1
  257. package/dist/workers/frontendWorker.js +0 -90
  258. package/dist/workers/frontendWorker.js.map +0 -1
  259. package/dist/workers/helloWorld.d.ts +0 -2
  260. package/dist/workers/helloWorld.d.ts.map +0 -1
  261. package/dist/workers/helloWorld.js +0 -135
  262. package/dist/workers/helloWorld.js.map +0 -1
  263. package/dist/workers/matterWorker.d.ts +0 -2
  264. package/dist/workers/matterWorker.d.ts.map +0 -1
  265. package/dist/workers/matterWorker.js +0 -104
  266. package/dist/workers/matterWorker.js.map +0 -1
  267. package/dist/workers/matterbridgeWorker.d.ts +0 -2
  268. package/dist/workers/matterbridgeWorker.d.ts.map +0 -1
  269. package/dist/workers/matterbridgeWorker.js +0 -75
  270. package/dist/workers/matterbridgeWorker.js.map +0 -1
  271. package/dist/workers/messageLab.d.ts +0 -134
  272. package/dist/workers/messageLab.d.ts.map +0 -1
  273. package/dist/workers/messageLab.js +0 -129
  274. package/dist/workers/messageLab.js.map +0 -1
  275. package/dist/workers/testWorker.d.ts +0 -2
  276. package/dist/workers/testWorker.d.ts.map +0 -1
  277. package/dist/workers/testWorker.js +0 -45
  278. package/dist/workers/testWorker.js.map +0 -1
  279. package/dist/workers/usage.d.ts +0 -19
  280. package/dist/workers/usage.d.ts.map +0 -1
  281. package/dist/workers/usage.js +0 -140
  282. package/dist/workers/usage.js.map +0 -1
  283. package/dist/workers/workerManager.d.ts +0 -115
  284. package/dist/workers/workerManager.d.ts.map +0 -1
  285. package/dist/workers/workerManager.js +0 -464
  286. package/dist/workers/workerManager.js.map +0 -1
  287. package/dist/workers/workerServer.d.ts +0 -126
  288. package/dist/workers/workerServer.d.ts.map +0 -1
  289. package/dist/workers/workerServer.js +0 -340
  290. package/dist/workers/workerServer.js.map +0 -1
  291. package/dist/workers/workerTypes.d.ts +0 -23
  292. package/dist/workers/workerTypes.d.ts.map +0 -1
  293. package/dist/workers/workerTypes.js +0 -3
  294. package/dist/workers/workerTypes.js.map +0 -1
@@ -1,41 +1,9 @@
1
- /**
2
- * This file contains the DeviceManager class.
3
- *
4
- * @file devices.ts
5
- * @author Luca Liguori
6
- * @created 2024-07-26
7
- * @version 1.1.2
8
- * @license Apache-2.0
9
- *
10
- * Copyright 2024, 2025, 2026 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
- // AnsiLogger module
25
1
  import { AnsiLogger, BLUE, CYAN, db, debugStringify, er } from 'node-ansi-logger';
26
- // @matterbridge
27
2
  import { hasParameter } from '@matterbridge/utils';
28
3
  import { dev } from '@matterbridge/types';
29
4
  import { BroadcastServer } from '@matterbridge/thread';
30
- /**
31
- * Converts a MatterbridgeEndpoint to a BaseDevice.
32
- *
33
- * @param {MatterbridgeEndpoint} device The MatterbridgeEndpoint to convert.
34
- * @returns {BaseDevice} The converted BaseDevice.
35
- */
36
5
  export function toBaseDevice(device) {
37
6
  return {
38
- // MatterbridgeEndpoint properties
39
7
  mode: device.mode,
40
8
  plugin: device.plugin,
41
9
  configUrl: device.configUrl,
@@ -55,25 +23,18 @@ export function toBaseDevice(device) {
55
23
  originalId: device.originalId,
56
24
  name: device.name,
57
25
  deviceType: device.deviceType,
58
- // Endpoint properties
59
26
  number: device.number,
60
27
  id: device.id,
61
28
  };
62
29
  }
63
- /**
64
- * Manages Matterbridge devices.
65
- */
66
30
  export class DeviceManager {
67
31
  _devices = new Map();
68
32
  log;
69
33
  server;
70
34
  debug = hasParameter('debug') || hasParameter('verbose');
71
35
  verbose = hasParameter('verbose');
72
- /**
73
- * Creates an instance of DeviceManager.
74
- */
75
36
  constructor() {
76
- this.log = new AnsiLogger({ logName: 'DeviceManager', logTimestampFormat: 4 /* TimestampFormat.TIME_MILLIS */, logLevel: hasParameter('debug') ? "debug" /* LogLevel.DEBUG */ : "info" /* LogLevel.INFO */ });
37
+ this.log = new AnsiLogger({ logName: 'DeviceManager', logTimestampFormat: 4, logLevel: hasParameter('debug') ? "debug" : "info" });
77
38
  this.log.debug('Matterbridge device manager starting...');
78
39
  this.server = new BroadcastServer('devices', this.log);
79
40
  this.server.on('broadcast_message', this.msgHandler.bind(this));
@@ -129,47 +90,18 @@ export class DeviceManager {
129
90
  }
130
91
  }
131
92
  }
132
- /**
133
- * Gets the number of devices.
134
- *
135
- * @returns {number} The number of devices.
136
- */
137
93
  get length() {
138
94
  return this._devices.size;
139
95
  }
140
- /**
141
- * Gets the number of devices.
142
- *
143
- * @returns {number} The number of devices.
144
- */
145
96
  get size() {
146
97
  return this._devices.size;
147
98
  }
148
- /**
149
- * Checks if a device with the specified unique ID exists.
150
- *
151
- * @param {string} uniqueId - The unique ID of the device.
152
- * @returns {boolean} True if the device exists, false otherwise.
153
- */
154
99
  has(uniqueId) {
155
100
  return this._devices.has(uniqueId);
156
101
  }
157
- /**
158
- * Gets a device by its unique ID.
159
- *
160
- * @param {string} uniqueId - The unique ID of the device.
161
- * @returns {MatterbridgeEndpoint | undefined} The device, or undefined if not found.
162
- */
163
102
  get(uniqueId) {
164
103
  return this._devices.get(uniqueId);
165
104
  }
166
- /**
167
- * Adds a device to the manager.
168
- *
169
- * @param {MatterbridgeEndpoint} device - The device to add.
170
- * @returns {MatterbridgeEndpoint} The added device.
171
- * @throws {Error} If the device does not have a unique ID.
172
- */
173
105
  set(device) {
174
106
  if (!device.uniqueId)
175
107
  throw new Error(`The device ${dev}${device.deviceName}${er} has not been initialized: uniqueId is required`);
@@ -178,13 +110,6 @@ export class DeviceManager {
178
110
  this._devices.set(device.uniqueId, device);
179
111
  return device;
180
112
  }
181
- /**
182
- * Removes a device from the manager.
183
- *
184
- * @param {MatterbridgeEndpoint} device - The device to remove.
185
- * @returns {boolean} True if the device was removed, false otherwise.
186
- * @throws {Error} If the device does not have a unique ID.
187
- */
188
113
  remove(device) {
189
114
  if (!device.uniqueId)
190
115
  throw new Error(`The device ${dev}${device.deviceName}${er} has not been initialized: uniqueId is required`);
@@ -192,59 +117,27 @@ export class DeviceManager {
192
117
  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`);
193
118
  return this._devices.delete(device.uniqueId);
194
119
  }
195
- /**
196
- * Clears all devices from the manager.
197
- */
198
120
  clear() {
199
121
  this._devices.clear();
200
122
  }
201
- /**
202
- * Converts a MatterbridgeEndpoint to a BaseDevice.
203
- *
204
- * @param {MatterbridgeEndpoint} device The MatterbridgeEndpoint to convert.
205
- * @returns {BaseDevice} The converted BaseDevice.
206
- */
207
123
  toBaseDevice(device) {
208
124
  return toBaseDevice(device);
209
125
  }
210
- /**
211
- * Gets an array of all devices.
212
- *
213
- * @returns {MatterbridgeEndpoint[]} An array of all devices.
214
- */
215
126
  array() {
216
127
  return Array.from(this._devices.values());
217
128
  }
218
- /**
219
- * Gets a base array of all devices suitable for serialization.
220
- *
221
- * @param {string} [pluginName] - Optional plugin name to filter devices.
222
- * @returns {ApiDevices[]} A base array of all devices.
223
- */
224
129
  baseArray(pluginName) {
225
130
  const devices = [];
226
131
  for (const device of Array.from(this._devices.values())) {
227
- // Filter by pluginName if provided
228
132
  if (pluginName && pluginName !== device.plugin)
229
133
  continue;
230
134
  devices.push(this.toBaseDevice(device));
231
135
  }
232
136
  return devices;
233
137
  }
234
- /**
235
- * Iterates over all devices.
236
- *
237
- * @returns {IterableIterator<MatterbridgeEndpoint>} An iterator for the devices.
238
- */
239
138
  [Symbol.iterator]() {
240
139
  return this._devices.values();
241
140
  }
242
- /**
243
- * Asynchronously iterates over each device and calls the provided callback function.
244
- *
245
- * @param {(device: MatterbridgeEndpoint) => Promise<void>} callback - The callback function to call with each device.
246
- * @returns {Promise<void>} A promise that resolves when all callbacks have been called.
247
- */
248
141
  async forEach(callback) {
249
142
  if (this.size === 0)
250
143
  return;
@@ -258,13 +151,7 @@ export class DeviceManager {
258
151
  });
259
152
  await Promise.all(tasks);
260
153
  }
261
- /**
262
- * Sets the log level.
263
- *
264
- * @param {LogLevel} logLevel - The log level to set.
265
- */
266
154
  set logLevel(logLevel) {
267
155
  this.log.logLevel = logLevel;
268
156
  }
269
157
  }
270
- //# sourceMappingURL=deviceManager.js.map
@@ -1,98 +1,23 @@
1
- /**
2
- * @description This file contains the AirConditioner class.
3
- * @file src/devices/airConditioner.ts
4
- * @author Luca Liguori
5
- * @created 2025-09-04
6
- * @version 1.0.0
7
- * @license Apache-2.0
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
1
  import { ThermostatUserInterfaceConfiguration } from '@matter/types/clusters/thermostat-user-interface-configuration';
24
2
  import { FanControl } from '@matter/types/clusters/fan-control';
25
3
  import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
26
- /**
27
- * Options for configuring an {@link AirConditioner} instance.
28
- *
29
- * All temperatures in °C. Typical valid range 0–50 unless otherwise noted.
30
- */
31
4
  export interface AirConditionerOptions {
32
- /** Local ambient temperature (°C). Default 23. */
33
5
  localTemperature?: number;
34
- /** Occupied heating setpoint (°C). Default 21. */
35
6
  occupiedHeatingSetpoint?: number;
36
- /** Occupied cooling setpoint (°C). Default 25. */
37
7
  occupiedCoolingSetpoint?: number;
38
- /** Minimum setpoint dead band (°C). Default 1. */
39
8
  minSetpointDeadBand?: number;
40
- /** Minimum heat setpoint limit (°C). Default 0. */
41
9
  minHeatSetpointLimit?: number;
42
- /** Maximum heat setpoint limit (°C). Default 50. */
43
10
  maxHeatSetpointLimit?: number;
44
- /** Minimum cool setpoint limit (°C). Default 0. */
45
11
  minCoolSetpointLimit?: number;
46
- /** Maximum cool setpoint limit (°C). Default 50. */
47
12
  maxCoolSetpointLimit?: number;
48
- /** Temperature display mode. Default Celsius. */
49
13
  temperatureDisplayMode?: ThermostatUserInterfaceConfiguration.TemperatureDisplayMode;
50
- /** Keypad lockout mode. Default NoLockout. */
51
14
  keypadLockout?: ThermostatUserInterfaceConfiguration.KeypadLockout;
52
- /** Schedule programming visibility. Default ScheduleProgrammingPermitted. */
53
15
  scheduleProgrammingVisibility?: ThermostatUserInterfaceConfiguration.ScheduleProgrammingVisibility;
54
- /** Fan mode. Default Off. */
55
16
  fanMode?: FanControl.FanMode;
56
- /** Fan mode sequence. Default OffLowMedHighAuto. */
57
17
  fanModeSequence?: FanControl.FanModeSequence;
58
- /** Target fan percent setting (0–100). Default 0. */
59
18
  percentSetting?: number;
60
- /** Current fan percent (0–100). Default 0. */
61
19
  percentCurrent?: number;
62
20
  }
63
21
  export declare class AirConditioner extends MatterbridgeEndpoint {
64
- /**
65
- * Creates an instance of the AirConditioner class.
66
- *
67
- * A Room Air Conditioner is a device which at a minimum is capable of being turned on and off and of controlling the temperature in the living space.
68
- * A Room Air Conditioner MAY also support additional capabilities via endpoint composition.
69
- * The DF (Dead Front) feature is required for the On/Off cluster in this device type.
70
- *
71
- * @param {string} name - The name of the air conditioner.
72
- * @param {string} serial - The serial number of the air conditioner.
73
- * @param {AirConditionerOptions} [options] - Optional configuration values. Missing fields use defaults.
74
- *
75
- * Options defaults:
76
- * - localTemperature: 23
77
- * - occupiedHeatingSetpoint: 21
78
- * - occupiedCoolingSetpoint: 25
79
- * - minSetpointDeadBand: 1
80
- * - minHeatSetpointLimit: 0
81
- * - maxHeatSetpointLimit: 50
82
- * - minCoolSetpointLimit: 0
83
- * - maxCoolSetpointLimit: 50
84
- * - temperatureDisplayMode: Celsius
85
- * - keypadLockout: NoLockout
86
- * - scheduleProgrammingVisibility: ScheduleProgrammingPermitted
87
- * - fanMode: Off
88
- * - fanModeSequence: OffLowMedHighAuto
89
- * - percentSetting: 0
90
- * - percentCurrent: 0
91
- *
92
- * @returns {AirConditioner} The AirConditioner instance.
93
- *
94
- * @remarks Not supported by Google Home.
95
- */
96
22
  constructor(name: string, serial: string, options?: AirConditionerOptions);
97
23
  }
98
- //# sourceMappingURL=airConditioner.d.ts.map
@@ -1,64 +1,8 @@
1
- /**
2
- * @description This file contains the AirConditioner class.
3
- * @file src/devices/airConditioner.ts
4
- * @author Luca Liguori
5
- * @created 2025-09-04
6
- * @version 1.0.0
7
- * @license Apache-2.0
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
- // Imports from @matter
24
1
  import { ThermostatUserInterfaceConfiguration } from '@matter/types/clusters/thermostat-user-interface-configuration';
25
2
  import { FanControl } from '@matter/types/clusters/fan-control';
26
- // Matterbridge
27
3
  import { airConditioner, powerSource } from '../matterbridgeDeviceTypes.js';
28
4
  import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
29
5
  export class AirConditioner extends MatterbridgeEndpoint {
30
- /**
31
- * Creates an instance of the AirConditioner class.
32
- *
33
- * A Room Air Conditioner is a device which at a minimum is capable of being turned on and off and of controlling the temperature in the living space.
34
- * A Room Air Conditioner MAY also support additional capabilities via endpoint composition.
35
- * The DF (Dead Front) feature is required for the On/Off cluster in this device type.
36
- *
37
- * @param {string} name - The name of the air conditioner.
38
- * @param {string} serial - The serial number of the air conditioner.
39
- * @param {AirConditionerOptions} [options] - Optional configuration values. Missing fields use defaults.
40
- *
41
- * Options defaults:
42
- * - localTemperature: 23
43
- * - occupiedHeatingSetpoint: 21
44
- * - occupiedCoolingSetpoint: 25
45
- * - minSetpointDeadBand: 1
46
- * - minHeatSetpointLimit: 0
47
- * - maxHeatSetpointLimit: 50
48
- * - minCoolSetpointLimit: 0
49
- * - maxCoolSetpointLimit: 50
50
- * - temperatureDisplayMode: Celsius
51
- * - keypadLockout: NoLockout
52
- * - scheduleProgrammingVisibility: ScheduleProgrammingPermitted
53
- * - fanMode: Off
54
- * - fanModeSequence: OffLowMedHighAuto
55
- * - percentSetting: 0
56
- * - percentCurrent: 0
57
- *
58
- * @returns {AirConditioner} The AirConditioner instance.
59
- *
60
- * @remarks Not supported by Google Home.
61
- */
62
6
  constructor(name, serial, options = {}) {
63
7
  const { localTemperature = 23, occupiedHeatingSetpoint = 21, occupiedCoolingSetpoint = 25, minSetpointDeadBand = 1, minHeatSetpointLimit = 0, maxHeatSetpointLimit = 50, minCoolSetpointLimit = 0, maxCoolSetpointLimit = 50, temperatureDisplayMode = ThermostatUserInterfaceConfiguration.TemperatureDisplayMode.Celsius, keypadLockout = ThermostatUserInterfaceConfiguration.KeypadLockout.NoLockout, scheduleProgrammingVisibility = ThermostatUserInterfaceConfiguration.ScheduleProgrammingVisibility.ScheduleProgrammingPermitted, fanMode = FanControl.FanMode.Off, fanModeSequence = FanControl.FanModeSequence.OffLowMedHighAuto, percentSetting = 0, percentCurrent = 0, } = options;
64
8
  super([airConditioner, powerSource], { id: `${name.replaceAll(' ', '')}-${serial.replaceAll(' ', '')}` });
@@ -71,4 +15,3 @@ export class AirConditioner extends MatterbridgeEndpoint {
71
15
  this.createDefaultFanControlClusterServer(fanMode, fanModeSequence, percentSetting, percentCurrent);
72
16
  }
73
17
  }
74
- //# sourceMappingURL=airConditioner.js.map
@@ -1,73 +1,16 @@
1
- /**
2
- * @description This file contains the BasicVideoPlayer class.
3
- * @file src/devices/basicVideoPlayer.ts
4
- * @author Luca Liguori
5
- * @created 2026-01-25
6
- * @version 1.0.0
7
- * @license Apache-2.0
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
1
  import { MaybePromise } from '@matter/general';
24
2
  import { MediaPlayback } from '@matter/types/clusters/media-playback';
25
3
  import { KeypadInput } from '@matter/types/clusters/keypad-input';
26
4
  import { MediaPlaybackServer } from '@matter/node/behaviors/media-playback';
27
5
  import { KeypadInputServer } from '@matter/node/behaviors/keypad-input';
28
6
  import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
29
- /**
30
- * Options for configuring an {@link AirConditioner} instance.
31
- *
32
- * All temperatures in °C. Typical valid range 0–50 unless otherwise noted.
33
- */
34
7
  export interface BasicVideoPlayerOptions {
35
- /** Device state */
36
8
  onOff?: boolean;
37
9
  playbackState?: MediaPlayback.PlaybackState;
38
10
  }
39
11
  export declare class BasicVideoPlayer extends MatterbridgeEndpoint {
40
- /**
41
- * Creates an instance of the BasicVideoPlayer class.
42
- *
43
- * A Video Player (either Basic or Casting) represents a device that is able to play media to a physical
44
- * output or to a display screen which is part of the device.
45
- *
46
- * @param {string} name - The name of the video player.
47
- * @param {string} serial - The serial number of the video player.
48
- * @param {BasicVideoPlayerOptions} [options] - Optional configuration values. Missing fields use defaults.
49
- *
50
- * Options defaults:
51
- * - onOff: false
52
- * - playbackState: NotPlaying
53
- *
54
- * @returns {BasicVideoPlayer} The BasicVideoPlayer instance.
55
- *
56
- * @remarks Not supported by Google Home.
57
- */
58
12
  constructor(name: string, serial: string, options?: BasicVideoPlayerOptions);
59
- /**
60
- * Creates a default Media Playback Cluster Server.
61
- *
62
- * @param {MediaPlayback.PlaybackState} currentState - The current state of the video player.
63
- * @returns {this} The current MatterbridgeEndpoint instance for chaining.
64
- */
65
13
  createDefaultMediaPlaybackClusterServer(currentState: MediaPlayback.PlaybackState): this;
66
- /**
67
- * Creates a default Keypad Input Cluster Server.
68
- *
69
- * @returns {this} The current MatterbridgeEndpoint instance for chaining.
70
- */
71
14
  createDefaultKeypadInputClusterServer(): this;
72
15
  }
73
16
  export declare class MatterbridgeMediaPlaybackServer extends MediaPlaybackServer {
@@ -85,4 +28,3 @@ export declare class MatterbridgeKeypadInputServer extends KeypadInputServer {
85
28
  initialize(): void;
86
29
  sendKey(request: KeypadInput.SendKeyRequest): MaybePromise<KeypadInput.SendKeyResponse>;
87
30
  }
88
- //# sourceMappingURL=basicVideoPlayer.d.ts.map
@@ -1,52 +1,11 @@
1
- /**
2
- * @description This file contains the BasicVideoPlayer class.
3
- * @file src/devices/basicVideoPlayer.ts
4
- * @author Luca Liguori
5
- * @created 2026-01-25
6
- * @version 1.0.0
7
- * @license Apache-2.0
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
1
  import { MediaPlayback } from '@matter/types/clusters/media-playback';
24
2
  import { KeypadInput } from '@matter/types/clusters/keypad-input';
25
3
  import { MediaPlaybackServer } from '@matter/node/behaviors/media-playback';
26
4
  import { KeypadInputServer } from '@matter/node/behaviors/keypad-input';
27
- // Matterbridge
28
5
  import { basicVideoPlayer, powerSource } from '../matterbridgeDeviceTypes.js';
29
6
  import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
30
7
  import { MatterbridgeOnOffServer, MatterbridgeServer } from '../matterbridgeBehaviors.js';
31
8
  export class BasicVideoPlayer extends MatterbridgeEndpoint {
32
- /**
33
- * Creates an instance of the BasicVideoPlayer class.
34
- *
35
- * A Video Player (either Basic or Casting) represents a device that is able to play media to a physical
36
- * output or to a display screen which is part of the device.
37
- *
38
- * @param {string} name - The name of the video player.
39
- * @param {string} serial - The serial number of the video player.
40
- * @param {BasicVideoPlayerOptions} [options] - Optional configuration values. Missing fields use defaults.
41
- *
42
- * Options defaults:
43
- * - onOff: false
44
- * - playbackState: NotPlaying
45
- *
46
- * @returns {BasicVideoPlayer} The BasicVideoPlayer instance.
47
- *
48
- * @remarks Not supported by Google Home.
49
- */
50
9
  constructor(name, serial, options = {}) {
51
10
  const { onOff = false, playbackState = MediaPlayback.PlaybackState.NotPlaying } = options;
52
11
  super([basicVideoPlayer, powerSource], { id: `${name.replaceAll(' ', '')}-${serial.replaceAll(' ', '')}` });
@@ -56,12 +15,6 @@ export class BasicVideoPlayer extends MatterbridgeEndpoint {
56
15
  this.createDefaultMediaPlaybackClusterServer(playbackState);
57
16
  this.createDefaultKeypadInputClusterServer();
58
17
  }
59
- /**
60
- * Creates a default Media Playback Cluster Server.
61
- *
62
- * @param {MediaPlayback.PlaybackState} currentState - The current state of the video player.
63
- * @returns {this} The current MatterbridgeEndpoint instance for chaining.
64
- */
65
18
  createDefaultMediaPlaybackClusterServer(currentState) {
66
19
  this.behaviors.require(MatterbridgeMediaPlaybackServer.enable({
67
20
  commands: { next: true, previous: true, skipForward: true, skipBackward: true },
@@ -70,15 +23,8 @@ export class BasicVideoPlayer extends MatterbridgeEndpoint {
70
23
  });
71
24
  return this;
72
25
  }
73
- /**
74
- * Creates a default Keypad Input Cluster Server.
75
- *
76
- * @returns {this} The current MatterbridgeEndpoint instance for chaining.
77
- */
78
26
  createDefaultKeypadInputClusterServer() {
79
- this.behaviors.require(MatterbridgeKeypadInputServer, {
80
- // No attributes to initialize
81
- });
27
+ this.behaviors.require(MatterbridgeKeypadInputServer, {});
82
28
  return this;
83
29
  }
84
30
  }
@@ -152,4 +98,3 @@ export class MatterbridgeKeypadInputServer extends KeypadInputServer {
152
98
  return { status: KeypadInput.Status.Success };
153
99
  }
154
100
  }
155
- //# sourceMappingURL=basicVideoPlayer.js.map
@@ -1,48 +1,5 @@
1
- /**
2
- * @description This file contains the BatteryStorage class.
3
- * @file src/devices/batteryStorage.ts
4
- * @author Luca Liguori
5
- * @contributor Ludovic BOUÉ
6
- * @created 2025-06-20
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
1
  import { PowerSource } from '@matter/types/clusters/power-source';
25
2
  import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
26
3
  export declare class BatteryStorage extends MatterbridgeEndpoint {
27
- /**
28
- * Creates an instance of the BatteryStorage class.
29
- *
30
- * @param {string} name - The name of the BatteryStorage.
31
- * @param {string} serial - The serial number of the BatteryStorage.
32
- * @param {number} [batPercentRemaining] - The percentage of battery remaining, defaults to `100` if not provided.
33
- * @param {PowerSource.BatChargeLevel} [batChargeLevel] - The battery charge level (default: PowerSource.BatChargeLevel.Ok).
34
- * @param {number} voltage - The voltage value in millivolts.
35
- * @param {number} current - The current value in milliamperes.
36
- * @param {number} power - The power value in milliwatts.
37
- * @param {number} energyImported - The total production value in mW/h.
38
- * @param {number} energyExported - The total production value in mW/h.
39
- * @param {number} [absMinPower] - Indicate the minimum electrical power in mw that the ESA can consume when switched on. Defaults to `0` if not provided.
40
- * @param {number} [absMaxPower] - Indicate the maximum electrical power in mw that the ESA can consume when switched on. Defaults to `0` if not provided.
41
- *
42
- * @remarks
43
- * - A battery storage inverter that can charge its battery at a maximum power of 2000W and can
44
- * discharge the battery at a maximum power of 3000W, would have a absMinPower: -3000W, absMaxPower: 2000W.
45
- */
46
4
  constructor(name: string, serial: string, batPercentRemaining?: number, batChargeLevel?: PowerSource.BatChargeLevel, voltage?: number | bigint | null, current?: number | bigint | null, power?: number | bigint | null, energyImported?: number | bigint | null, energyExported?: number | bigint | null, absMinPower?: number, absMaxPower?: number);
47
5
  }
48
- //# sourceMappingURL=batteryStorage.d.ts.map
@@ -1,53 +1,9 @@
1
- /**
2
- * @description This file contains the BatteryStorage class.
3
- * @file src/devices/batteryStorage.ts
4
- * @author Luca Liguori
5
- * @contributor Ludovic BOUÉ
6
- * @created 2025-06-20
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
25
1
  import { PowerSourceTag } from '@matter/node';
26
2
  import { DeviceEnergyManagement } from '@matter/types/clusters/device-energy-management';
27
3
  import { PowerSource } from '@matter/types/clusters/power-source';
28
- // Matterbridge
29
4
  import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
30
5
  import { deviceEnergyManagement, electricalSensor, batteryStorage, powerSource } from '../matterbridgeDeviceTypes.js';
31
6
  export class BatteryStorage extends MatterbridgeEndpoint {
32
- /**
33
- * Creates an instance of the BatteryStorage class.
34
- *
35
- * @param {string} name - The name of the BatteryStorage.
36
- * @param {string} serial - The serial number of the BatteryStorage.
37
- * @param {number} [batPercentRemaining] - The percentage of battery remaining, defaults to `100` if not provided.
38
- * @param {PowerSource.BatChargeLevel} [batChargeLevel] - The battery charge level (default: PowerSource.BatChargeLevel.Ok).
39
- * @param {number} voltage - The voltage value in millivolts.
40
- * @param {number} current - The current value in milliamperes.
41
- * @param {number} power - The power value in milliwatts.
42
- * @param {number} energyImported - The total production value in mW/h.
43
- * @param {number} energyExported - The total production value in mW/h.
44
- * @param {number} [absMinPower] - Indicate the minimum electrical power in mw that the ESA can consume when switched on. Defaults to `0` if not provided.
45
- * @param {number} [absMaxPower] - Indicate the maximum electrical power in mw that the ESA can consume when switched on. Defaults to `0` if not provided.
46
- *
47
- * @remarks
48
- * - A battery storage inverter that can charge its battery at a maximum power of 2000W and can
49
- * discharge the battery at a maximum power of 3000W, would have a absMinPower: -3000W, absMaxPower: 2000W.
50
- */
51
7
  constructor(name, serial, batPercentRemaining = 100, batChargeLevel = PowerSource.BatChargeLevel.Ok, voltage = null, current = null, power = null, energyImported = null, energyExported = null, absMinPower = 0, absMaxPower = 0) {
52
8
  super([batteryStorage, electricalSensor, deviceEnergyManagement], { id: `${name.replaceAll(' ', '')}-${serial.replaceAll(' ', '')}` });
53
9
  this.createDefaultIdentifyClusterServer()
@@ -58,12 +14,10 @@ export class BatteryStorage extends MatterbridgeEndpoint {
58
14
  .createDefaultDeviceEnergyManagementClusterServer(DeviceEnergyManagement.EsaType.BatteryStorage, true, DeviceEnergyManagement.EsaState.Online, absMinPower, absMaxPower)
59
15
  .createDefaultDeviceEnergyManagementModeClusterServer()
60
16
  .addRequiredClusterServers();
61
- // Add separate PowerSource child devices cause in matter.js the PowerSource cluster is not supported with both features Wired and Battery.
62
- // Probably this is also an error in the specification...
63
17
  this.addChildDeviceType('BatteryPowerSource', powerSource, {
64
18
  tagList: [{ mfgCode: null, namespaceId: PowerSourceTag.Battery.namespaceId, tag: PowerSourceTag.Battery.tag, label: null }],
65
19
  })
66
- .createDefaultPowerSourceRechargeableBatteryClusterServer(batPercentRemaining, batChargeLevel, 24_000) // Battery voltage in mV (24V).
20
+ .createDefaultPowerSourceRechargeableBatteryClusterServer(batPercentRemaining, batChargeLevel, 24_000)
67
21
  .addRequiredClusterServers();
68
22
  this.addChildDeviceType('GridPowerSource', powerSource, {
69
23
  tagList: [{ mfgCode: null, namespaceId: PowerSourceTag.Grid.namespaceId, tag: PowerSourceTag.Grid.tag, label: null }],
@@ -72,4 +26,3 @@ export class BatteryStorage extends MatterbridgeEndpoint {
72
26
  .addRequiredClusterServers();
73
27
  }
74
28
  }
75
- //# sourceMappingURL=batteryStorage.js.map