matterbridge 3.4.1 → 3.4.2-dev-20251202-c41a119

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 (326) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/broadcastServer.js +0 -112
  3. package/dist/broadcastServerTypes.js +0 -24
  4. package/dist/cli.js +1 -97
  5. package/dist/cliEmitter.js +0 -37
  6. package/dist/cliHistory.js +0 -38
  7. package/dist/clusters/export.js +0 -2
  8. package/dist/deviceManager.js +1 -113
  9. package/dist/devices/airConditioner.js +0 -57
  10. package/dist/devices/batteryStorage.js +1 -48
  11. package/dist/devices/cooktop.js +0 -56
  12. package/dist/devices/dishwasher.js +0 -57
  13. package/dist/devices/evse.js +10 -74
  14. package/dist/devices/export.js +0 -5
  15. package/dist/devices/extractorHood.js +0 -43
  16. package/dist/devices/heatPump.js +2 -50
  17. package/dist/devices/laundryDryer.js +3 -62
  18. package/dist/devices/laundryWasher.js +4 -70
  19. package/dist/devices/microwaveOven.js +5 -88
  20. package/dist/devices/oven.js +0 -85
  21. package/dist/devices/refrigerator.js +0 -102
  22. package/dist/devices/roboticVacuumCleaner.js +9 -100
  23. package/dist/devices/solarPower.js +0 -38
  24. package/dist/devices/speaker.js +0 -84
  25. package/dist/devices/temperatureControl.js +3 -24
  26. package/dist/devices/waterHeater.js +2 -82
  27. package/dist/dgram/coap.js +13 -126
  28. package/dist/dgram/dgram.js +2 -114
  29. package/dist/dgram/mb_coap.js +3 -41
  30. package/dist/dgram/mb_mdns.js +15 -80
  31. package/dist/dgram/mdns.js +137 -299
  32. package/dist/dgram/multicast.js +1 -62
  33. package/dist/dgram/unicast.js +0 -54
  34. package/dist/frontend.js +35 -455
  35. package/dist/frontendTypes.js +0 -45
  36. package/dist/helpers.js +0 -53
  37. package/dist/index.js +0 -25
  38. package/dist/jestutils/export.js +0 -1
  39. package/dist/jestutils/jestHelpers.js +13 -368
  40. package/dist/logger/export.js +0 -1
  41. package/dist/matter/behaviors.js +0 -2
  42. package/dist/matter/clusters.js +0 -2
  43. package/dist/matter/devices.js +0 -2
  44. package/dist/matter/endpoints.js +0 -2
  45. package/dist/matter/export.js +0 -3
  46. package/dist/matter/types.js +0 -3
  47. package/dist/matterNode.js +8 -369
  48. package/dist/matterbridge.js +46 -807
  49. package/dist/matterbridgeAccessoryPlatform.js +0 -38
  50. package/dist/matterbridgeBehaviors.js +5 -68
  51. package/dist/matterbridgeDeviceTypes.js +14 -635
  52. package/dist/matterbridgeDynamicPlatform.js +0 -38
  53. package/dist/matterbridgeEndpoint.js +53 -1444
  54. package/dist/matterbridgeEndpointHelpers.js +20 -483
  55. package/dist/matterbridgeEndpointTypes.js +0 -25
  56. package/dist/matterbridgePlatform.js +1 -450
  57. package/dist/matterbridgeTypes.js +0 -26
  58. package/dist/pluginManager.js +5 -341
  59. package/dist/shelly.js +7 -178
  60. package/dist/storage/export.js +0 -1
  61. package/dist/update.js +1 -93
  62. package/dist/utils/colorUtils.js +2 -97
  63. package/dist/utils/commandLine.js +0 -60
  64. package/dist/utils/copyDirectory.js +0 -37
  65. package/dist/utils/createDirectory.js +0 -33
  66. package/dist/utils/createZip.js +2 -47
  67. package/dist/utils/deepCopy.js +0 -39
  68. package/dist/utils/deepEqual.js +1 -72
  69. package/dist/utils/error.js +0 -42
  70. package/dist/utils/export.js +0 -1
  71. package/dist/utils/format.js +0 -49
  72. package/dist/utils/hex.js +0 -124
  73. package/dist/utils/inspector.js +1 -69
  74. package/dist/utils/isvalid.js +0 -101
  75. package/dist/utils/network.js +5 -96
  76. package/dist/utils/spawn.js +1 -71
  77. package/dist/utils/tracker.js +1 -64
  78. package/dist/utils/wait.js +8 -60
  79. package/dist/workerGlobalPrefix.js +5 -37
  80. package/dist/workerTypes.js +0 -24
  81. package/dist/workers.js +4 -68
  82. package/frontend/build/assets/index.js +4 -4
  83. package/frontend/build/assets/vendor_mui.js +1 -1
  84. package/frontend/package.json +1 -1
  85. package/npm-shrinkwrap.json +14 -10
  86. package/package.json +1 -2
  87. package/dist/broadcastServer.d.ts +0 -136
  88. package/dist/broadcastServer.d.ts.map +0 -1
  89. package/dist/broadcastServer.js.map +0 -1
  90. package/dist/broadcastServerTypes.d.ts +0 -841
  91. package/dist/broadcastServerTypes.d.ts.map +0 -1
  92. package/dist/broadcastServerTypes.js.map +0 -1
  93. package/dist/cli.d.ts +0 -30
  94. package/dist/cli.d.ts.map +0 -1
  95. package/dist/cli.js.map +0 -1
  96. package/dist/cliEmitter.d.ts +0 -50
  97. package/dist/cliEmitter.d.ts.map +0 -1
  98. package/dist/cliEmitter.js.map +0 -1
  99. package/dist/cliHistory.d.ts +0 -48
  100. package/dist/cliHistory.d.ts.map +0 -1
  101. package/dist/cliHistory.js.map +0 -1
  102. package/dist/clusters/export.d.ts +0 -2
  103. package/dist/clusters/export.d.ts.map +0 -1
  104. package/dist/clusters/export.js.map +0 -1
  105. package/dist/deviceManager.d.ts +0 -135
  106. package/dist/deviceManager.d.ts.map +0 -1
  107. package/dist/deviceManager.js.map +0 -1
  108. package/dist/devices/airConditioner.d.ts +0 -98
  109. package/dist/devices/airConditioner.d.ts.map +0 -1
  110. package/dist/devices/airConditioner.js.map +0 -1
  111. package/dist/devices/batteryStorage.d.ts +0 -48
  112. package/dist/devices/batteryStorage.d.ts.map +0 -1
  113. package/dist/devices/batteryStorage.js.map +0 -1
  114. package/dist/devices/cooktop.d.ts +0 -61
  115. package/dist/devices/cooktop.d.ts.map +0 -1
  116. package/dist/devices/cooktop.js.map +0 -1
  117. package/dist/devices/dishwasher.d.ts +0 -71
  118. package/dist/devices/dishwasher.d.ts.map +0 -1
  119. package/dist/devices/dishwasher.js.map +0 -1
  120. package/dist/devices/evse.d.ts +0 -76
  121. package/dist/devices/evse.d.ts.map +0 -1
  122. package/dist/devices/evse.js.map +0 -1
  123. package/dist/devices/export.d.ts +0 -17
  124. package/dist/devices/export.d.ts.map +0 -1
  125. package/dist/devices/export.js.map +0 -1
  126. package/dist/devices/extractorHood.d.ts +0 -46
  127. package/dist/devices/extractorHood.d.ts.map +0 -1
  128. package/dist/devices/extractorHood.js.map +0 -1
  129. package/dist/devices/heatPump.d.ts +0 -47
  130. package/dist/devices/heatPump.d.ts.map +0 -1
  131. package/dist/devices/heatPump.js.map +0 -1
  132. package/dist/devices/laundryDryer.d.ts +0 -67
  133. package/dist/devices/laundryDryer.d.ts.map +0 -1
  134. package/dist/devices/laundryDryer.js.map +0 -1
  135. package/dist/devices/laundryWasher.d.ts +0 -81
  136. package/dist/devices/laundryWasher.d.ts.map +0 -1
  137. package/dist/devices/laundryWasher.js.map +0 -1
  138. package/dist/devices/microwaveOven.d.ts +0 -168
  139. package/dist/devices/microwaveOven.d.ts.map +0 -1
  140. package/dist/devices/microwaveOven.js.map +0 -1
  141. package/dist/devices/oven.d.ts +0 -105
  142. package/dist/devices/oven.d.ts.map +0 -1
  143. package/dist/devices/oven.js.map +0 -1
  144. package/dist/devices/refrigerator.d.ts +0 -118
  145. package/dist/devices/refrigerator.d.ts.map +0 -1
  146. package/dist/devices/refrigerator.js.map +0 -1
  147. package/dist/devices/roboticVacuumCleaner.d.ts +0 -112
  148. package/dist/devices/roboticVacuumCleaner.d.ts.map +0 -1
  149. package/dist/devices/roboticVacuumCleaner.js.map +0 -1
  150. package/dist/devices/solarPower.d.ts +0 -40
  151. package/dist/devices/solarPower.d.ts.map +0 -1
  152. package/dist/devices/solarPower.js.map +0 -1
  153. package/dist/devices/speaker.d.ts +0 -87
  154. package/dist/devices/speaker.d.ts.map +0 -1
  155. package/dist/devices/speaker.js.map +0 -1
  156. package/dist/devices/temperatureControl.d.ts +0 -166
  157. package/dist/devices/temperatureControl.d.ts.map +0 -1
  158. package/dist/devices/temperatureControl.js.map +0 -1
  159. package/dist/devices/waterHeater.d.ts +0 -111
  160. package/dist/devices/waterHeater.d.ts.map +0 -1
  161. package/dist/devices/waterHeater.js.map +0 -1
  162. package/dist/dgram/coap.d.ts +0 -205
  163. package/dist/dgram/coap.d.ts.map +0 -1
  164. package/dist/dgram/coap.js.map +0 -1
  165. package/dist/dgram/dgram.d.ts +0 -141
  166. package/dist/dgram/dgram.d.ts.map +0 -1
  167. package/dist/dgram/dgram.js.map +0 -1
  168. package/dist/dgram/mb_coap.d.ts +0 -24
  169. package/dist/dgram/mb_coap.d.ts.map +0 -1
  170. package/dist/dgram/mb_coap.js.map +0 -1
  171. package/dist/dgram/mb_mdns.d.ts +0 -24
  172. package/dist/dgram/mb_mdns.d.ts.map +0 -1
  173. package/dist/dgram/mb_mdns.js.map +0 -1
  174. package/dist/dgram/mdns.d.ts +0 -290
  175. package/dist/dgram/mdns.d.ts.map +0 -1
  176. package/dist/dgram/mdns.js.map +0 -1
  177. package/dist/dgram/multicast.d.ts +0 -67
  178. package/dist/dgram/multicast.d.ts.map +0 -1
  179. package/dist/dgram/multicast.js.map +0 -1
  180. package/dist/dgram/unicast.d.ts +0 -56
  181. package/dist/dgram/unicast.d.ts.map +0 -1
  182. package/dist/dgram/unicast.js.map +0 -1
  183. package/dist/frontend.d.ts +0 -238
  184. package/dist/frontend.d.ts.map +0 -1
  185. package/dist/frontend.js.map +0 -1
  186. package/dist/frontendTypes.d.ts +0 -529
  187. package/dist/frontendTypes.d.ts.map +0 -1
  188. package/dist/frontendTypes.js.map +0 -1
  189. package/dist/helpers.d.ts +0 -48
  190. package/dist/helpers.d.ts.map +0 -1
  191. package/dist/helpers.js.map +0 -1
  192. package/dist/index.d.ts +0 -34
  193. package/dist/index.d.ts.map +0 -1
  194. package/dist/index.js.map +0 -1
  195. package/dist/jestutils/export.d.ts +0 -2
  196. package/dist/jestutils/export.d.ts.map +0 -1
  197. package/dist/jestutils/export.js.map +0 -1
  198. package/dist/jestutils/jestHelpers.d.ts +0 -340
  199. package/dist/jestutils/jestHelpers.d.ts.map +0 -1
  200. package/dist/jestutils/jestHelpers.js.map +0 -1
  201. package/dist/logger/export.d.ts +0 -2
  202. package/dist/logger/export.d.ts.map +0 -1
  203. package/dist/logger/export.js.map +0 -1
  204. package/dist/matter/behaviors.d.ts +0 -2
  205. package/dist/matter/behaviors.d.ts.map +0 -1
  206. package/dist/matter/behaviors.js.map +0 -1
  207. package/dist/matter/clusters.d.ts +0 -2
  208. package/dist/matter/clusters.d.ts.map +0 -1
  209. package/dist/matter/clusters.js.map +0 -1
  210. package/dist/matter/devices.d.ts +0 -2
  211. package/dist/matter/devices.d.ts.map +0 -1
  212. package/dist/matter/devices.js.map +0 -1
  213. package/dist/matter/endpoints.d.ts +0 -2
  214. package/dist/matter/endpoints.d.ts.map +0 -1
  215. package/dist/matter/endpoints.js.map +0 -1
  216. package/dist/matter/export.d.ts +0 -5
  217. package/dist/matter/export.d.ts.map +0 -1
  218. package/dist/matter/export.js.map +0 -1
  219. package/dist/matter/types.d.ts +0 -3
  220. package/dist/matter/types.d.ts.map +0 -1
  221. package/dist/matter/types.js.map +0 -1
  222. package/dist/matterNode.d.ts +0 -342
  223. package/dist/matterNode.d.ts.map +0 -1
  224. package/dist/matterNode.js.map +0 -1
  225. package/dist/matterbridge.d.ts +0 -493
  226. package/dist/matterbridge.d.ts.map +0 -1
  227. package/dist/matterbridge.js.map +0 -1
  228. package/dist/matterbridgeAccessoryPlatform.d.ts +0 -41
  229. package/dist/matterbridgeAccessoryPlatform.d.ts.map +0 -1
  230. package/dist/matterbridgeAccessoryPlatform.js.map +0 -1
  231. package/dist/matterbridgeBehaviors.d.ts +0 -2404
  232. package/dist/matterbridgeBehaviors.d.ts.map +0 -1
  233. package/dist/matterbridgeBehaviors.js.map +0 -1
  234. package/dist/matterbridgeDeviceTypes.d.ts +0 -698
  235. package/dist/matterbridgeDeviceTypes.d.ts.map +0 -1
  236. package/dist/matterbridgeDeviceTypes.js.map +0 -1
  237. package/dist/matterbridgeDynamicPlatform.d.ts +0 -41
  238. package/dist/matterbridgeDynamicPlatform.d.ts.map +0 -1
  239. package/dist/matterbridgeDynamicPlatform.js.map +0 -1
  240. package/dist/matterbridgeEndpoint.d.ts +0 -1507
  241. package/dist/matterbridgeEndpoint.d.ts.map +0 -1
  242. package/dist/matterbridgeEndpoint.js.map +0 -1
  243. package/dist/matterbridgeEndpointHelpers.d.ts +0 -787
  244. package/dist/matterbridgeEndpointHelpers.d.ts.map +0 -1
  245. package/dist/matterbridgeEndpointHelpers.js.map +0 -1
  246. package/dist/matterbridgeEndpointTypes.d.ts +0 -166
  247. package/dist/matterbridgeEndpointTypes.d.ts.map +0 -1
  248. package/dist/matterbridgeEndpointTypes.js.map +0 -1
  249. package/dist/matterbridgePlatform.d.ts +0 -537
  250. package/dist/matterbridgePlatform.d.ts.map +0 -1
  251. package/dist/matterbridgePlatform.js.map +0 -1
  252. package/dist/matterbridgeTypes.d.ts +0 -251
  253. package/dist/matterbridgeTypes.d.ts.map +0 -1
  254. package/dist/matterbridgeTypes.js.map +0 -1
  255. package/dist/pluginManager.d.ts +0 -372
  256. package/dist/pluginManager.d.ts.map +0 -1
  257. package/dist/pluginManager.js.map +0 -1
  258. package/dist/shelly.d.ts +0 -181
  259. package/dist/shelly.d.ts.map +0 -1
  260. package/dist/shelly.js.map +0 -1
  261. package/dist/storage/export.d.ts +0 -2
  262. package/dist/storage/export.d.ts.map +0 -1
  263. package/dist/storage/export.js.map +0 -1
  264. package/dist/update.d.ts +0 -84
  265. package/dist/update.d.ts.map +0 -1
  266. package/dist/update.js.map +0 -1
  267. package/dist/utils/colorUtils.d.ts +0 -101
  268. package/dist/utils/colorUtils.d.ts.map +0 -1
  269. package/dist/utils/colorUtils.js.map +0 -1
  270. package/dist/utils/commandLine.d.ts +0 -66
  271. package/dist/utils/commandLine.d.ts.map +0 -1
  272. package/dist/utils/commandLine.js.map +0 -1
  273. package/dist/utils/copyDirectory.d.ts +0 -35
  274. package/dist/utils/copyDirectory.d.ts.map +0 -1
  275. package/dist/utils/copyDirectory.js.map +0 -1
  276. package/dist/utils/createDirectory.d.ts +0 -34
  277. package/dist/utils/createDirectory.d.ts.map +0 -1
  278. package/dist/utils/createDirectory.js.map +0 -1
  279. package/dist/utils/createZip.d.ts +0 -39
  280. package/dist/utils/createZip.d.ts.map +0 -1
  281. package/dist/utils/createZip.js.map +0 -1
  282. package/dist/utils/deepCopy.d.ts +0 -32
  283. package/dist/utils/deepCopy.d.ts.map +0 -1
  284. package/dist/utils/deepCopy.js.map +0 -1
  285. package/dist/utils/deepEqual.d.ts +0 -54
  286. package/dist/utils/deepEqual.d.ts.map +0 -1
  287. package/dist/utils/deepEqual.js.map +0 -1
  288. package/dist/utils/error.d.ts +0 -45
  289. package/dist/utils/error.d.ts.map +0 -1
  290. package/dist/utils/error.js.map +0 -1
  291. package/dist/utils/export.d.ts +0 -13
  292. package/dist/utils/export.d.ts.map +0 -1
  293. package/dist/utils/export.js.map +0 -1
  294. package/dist/utils/format.d.ts +0 -53
  295. package/dist/utils/format.d.ts.map +0 -1
  296. package/dist/utils/format.js.map +0 -1
  297. package/dist/utils/hex.d.ts +0 -89
  298. package/dist/utils/hex.d.ts.map +0 -1
  299. package/dist/utils/hex.js.map +0 -1
  300. package/dist/utils/inspector.d.ts +0 -87
  301. package/dist/utils/inspector.d.ts.map +0 -1
  302. package/dist/utils/inspector.js.map +0 -1
  303. package/dist/utils/isvalid.d.ts +0 -103
  304. package/dist/utils/isvalid.d.ts.map +0 -1
  305. package/dist/utils/isvalid.js.map +0 -1
  306. package/dist/utils/network.d.ts +0 -111
  307. package/dist/utils/network.d.ts.map +0 -1
  308. package/dist/utils/network.js.map +0 -1
  309. package/dist/utils/spawn.d.ts +0 -33
  310. package/dist/utils/spawn.d.ts.map +0 -1
  311. package/dist/utils/spawn.js.map +0 -1
  312. package/dist/utils/tracker.d.ts +0 -108
  313. package/dist/utils/tracker.d.ts.map +0 -1
  314. package/dist/utils/tracker.js.map +0 -1
  315. package/dist/utils/wait.d.ts +0 -54
  316. package/dist/utils/wait.d.ts.map +0 -1
  317. package/dist/utils/wait.js.map +0 -1
  318. package/dist/workerGlobalPrefix.d.ts +0 -25
  319. package/dist/workerGlobalPrefix.d.ts.map +0 -1
  320. package/dist/workerGlobalPrefix.js.map +0 -1
  321. package/dist/workerTypes.d.ts +0 -52
  322. package/dist/workerTypes.d.ts.map +0 -1
  323. package/dist/workerTypes.js.map +0 -1
  324. package/dist/workers.d.ts +0 -69
  325. package/dist/workers.d.ts.map +0 -1
  326. package/dist/workers.js.map +0 -1
@@ -1,49 +1,13 @@
1
- /**
2
- * @description This file contains the Oven class.
3
- * @file src/devices/oven.ts
4
- * @author Luca Liguori
5
- * @created 2025-05-25
6
- * @version 1.1.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 { ModeBase } from '@matter/types/clusters/mode-base';
24
2
  import { OvenMode } from '@matter/types/clusters/oven-mode';
25
3
  import { OperationalState } from '@matter/types/clusters/operational-state';
26
4
  import { OvenModeServer } from '@matter/node/behaviors/oven-mode';
27
5
  import { OvenCavityOperationalStateServer } from '@matter/node/behaviors/oven-cavity-operational-state';
28
- // Matterbridge
29
6
  import { oven, powerSource, temperatureControlledCabinetHeater } from '../matterbridgeDeviceTypes.js';
30
7
  import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
31
8
  import { MatterbridgeServer } from '../matterbridgeBehaviors.js';
32
9
  import { createLevelTemperatureControlClusterServer } from './temperatureControl.js';
33
10
  export class Oven extends MatterbridgeEndpoint {
34
- /**
35
- * Creates an instance of the Oven class.
36
- *
37
- * @param {string} name - The name of the oven.
38
- * @param {string} serial - The serial number of the oven.
39
- *
40
- * @remarks
41
- * 13.9 An oven represents a device that contains one or more cabinets, and optionally a single cooktop,
42
- * that are all capable of heating food. Examples of consumer products implementing this device type
43
- * include ovens, wall ovens, convection ovens, etc.
44
- * An oven is always defined via endpoint composition.
45
- * - Use `addCabinet` to add one or more cabinets to the oven.
46
- */
47
11
  constructor(name, serial) {
48
12
  super([oven, powerSource], { id: `${name.replaceAll(' ', '')}-${serial.replaceAll(' ', '')}` });
49
13
  this.createDefaultIdentifyClusterServer();
@@ -51,25 +15,6 @@ export class Oven extends MatterbridgeEndpoint {
51
15
  this.createDefaultPowerSourceWiredClusterServer();
52
16
  this.addFixedLabel('composed', 'Oven');
53
17
  }
54
- /**
55
- * Adds a Temperature Controlled Cabinet Heater to the oven.
56
- *
57
- * @param {string} name - The name of the cabinet.
58
- * @param {Semtag[]} tagList - The tagList associated with the cabinet.
59
- * @param {number} currentMode - The current mode of the cabinet. Defaults to 2 (which corresponds to 'Convection').
60
- * @param {OvenMode.ModeOption[]} supportedModes - The supported modes of the cabinet. Defaults to a set of common oven modes.
61
- * @param {number} selectedTemperatureLevel - The selected temperature level as an index of the supportedTemperatureLevels array. Defaults to 1 (which corresponds to 'Warm').
62
- * @param {string[]} supportedTemperatureLevels - The list of supported temperature levels for the cabinet. Defaults to ['Defrost', '180°', '190°', '200°', '250°', '300°'].
63
- * @param {OperationalState.OperationalStateEnum} operationalState - The initial operational state of the cabinet. Defaults to Stopped.
64
- * @param {number} [currentPhase] - Optional: the current phase of the cabinet.
65
- * @param {string[]} [phaseList] - Optional: the list of phases for the cabinet.
66
- *
67
- * @returns {MatterbridgeEndpoint} The MatterbridgeEndpoint instance representing the cabinet.
68
- *
69
- * @remarks
70
- * 13.4.1 A Temperature Controlled Cabinet Heater is a device that provides a heated space for warming food.
71
- * It is typically installed within an oven and can be used in conjunction with other heating elements.
72
- */
73
18
  addCabinet(name, tagList, currentMode = 2, supportedModes = [
74
19
  { label: 'Bake', mode: 1, modeTags: [{ value: OvenMode.ModeTag.Bake }] },
75
20
  { label: 'Convection', mode: 2, modeTags: [{ value: OvenMode.ModeTag.Convection }] },
@@ -91,19 +36,6 @@ export class Oven extends MatterbridgeEndpoint {
91
36
  this.createDefaultOvenCavityOperationalStateClusterServer(cabinet, operationalState, currentPhase, phaseList);
92
37
  return cabinet;
93
38
  }
94
- /**
95
- * Creates a default OvenMode Cluster Server.
96
- *
97
- * @param {MatterbridgeEndpoint} endpoint - The Matterbridge endpoint instance.
98
- * @param {number} currentMode - The current mode of the oven.
99
- * @param {OvenMode.ModeOption[]} supportedModes - The supported modes of the oven.
100
- *
101
- * @returns {MatterbridgeEndpoint} The current MatterbridgeEndpoint instance for chaining.
102
- *
103
- * @remarks
104
- * - supportedModes is a fixed attribute. It cannot be changed at runtime.
105
- * - currentMode persists across reboots.
106
- */
107
39
  createDefaultOvenModeClusterServer(endpoint, currentMode, supportedModes) {
108
40
  endpoint.behaviors.require(MatterbridgeOvenModeServer, {
109
41
  supportedModes,
@@ -111,20 +43,6 @@ export class Oven extends MatterbridgeEndpoint {
111
43
  });
112
44
  return endpoint;
113
45
  }
114
- /**
115
- * Creates a default Oven Cavity Operational State Cluster Server.
116
- *
117
- * @param {MatterbridgeEndpoint} endpoint - The Matterbridge endpoint instance.
118
- * @param {OperationalState.OperationalStateEnum} operationalState - The initial operational state.
119
- * @param {number} [currentPhase] - The current phase of the oven cavity.
120
- * @param {string[]} [phaseList] - The list of phases for the oven cavity.
121
- *
122
- * @returns {this} The current MatterbridgeEndpoint instance for chaining.
123
- *
124
- * @remarks
125
- * For this derived cluster, only these pre-defined strings may be used in the PhaseList attribute:
126
- * "pre-heating", "pre-heated", and "cooling down".
127
- */
128
46
  createDefaultOvenCavityOperationalStateClusterServer(endpoint, operationalState = OperationalState.OperationalStateEnum.Stopped, currentPhase, phaseList) {
129
47
  endpoint.behaviors.require(MatterbridgeOvenCavityOperationalStateServer, {
130
48
  phaseList: phaseList || null,
@@ -136,7 +54,6 @@ export class Oven extends MatterbridgeEndpoint {
136
54
  return endpoint;
137
55
  }
138
56
  }
139
- // Server for OvenMode
140
57
  export class MatterbridgeOvenModeServer extends OvenModeServer {
141
58
  initialize() {
142
59
  const device = this.endpoint.stateOf(MatterbridgeServer);
@@ -156,7 +73,6 @@ export class MatterbridgeOvenModeServer extends OvenModeServer {
156
73
  }
157
74
  }
158
75
  }
159
- // Server for OvenCavityOperationalState
160
76
  export class MatterbridgeOvenCavityOperationalStateServer extends OvenCavityOperationalStateServer {
161
77
  initialize() {
162
78
  const device = this.endpoint.stateOf(MatterbridgeServer);
@@ -183,4 +99,3 @@ export class MatterbridgeOvenCavityOperationalStateServer extends OvenCavityOper
183
99
  };
184
100
  }
185
101
  }
186
- //# sourceMappingURL=oven.js.map
@@ -1,48 +1,12 @@
1
- /**
2
- * @description This file contains the Refrigerator class.
3
- * @file src/devices/refrigerator.ts
4
- * @author Luca Liguori
5
- * @created 2025-05-25
6
- * @version 1.1.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 { ModeBase } from '@matter/types/clusters/mode-base';
24
2
  import { RefrigeratorAndTemperatureControlledCabinetMode } from '@matter/types/clusters/refrigerator-and-temperature-controlled-cabinet-mode';
25
3
  import { RefrigeratorAndTemperatureControlledCabinetModeServer } from '@matter/node/behaviors/refrigerator-and-temperature-controlled-cabinet-mode';
26
4
  import { RefrigeratorAlarmServer } from '@matter/node/behaviors/refrigerator-alarm';
27
- // Matterbridge
28
5
  import { powerSource, refrigerator, temperatureControlledCabinetCooler } from '../matterbridgeDeviceTypes.js';
29
6
  import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
30
7
  import { MatterbridgeServer } from '../matterbridgeBehaviors.js';
31
8
  import { createLevelTemperatureControlClusterServer } from './temperatureControl.js';
32
9
  export class Refrigerator extends MatterbridgeEndpoint {
33
- /**
34
- * Creates an instance of the Refrigerator class.
35
- *
36
- * @param {string} name - The name of the refrigerator.
37
- * @param {string} serial - The serial number of the refrigerator.
38
- *
39
- * @remarks
40
- * 13.2 A refrigerator represents a device that contains one or more cabinets that are capable of chilling or
41
- * freezing food. Examples of consumer products that MAY make use of this device type include refrigerators,
42
- * freezers, and wine coolers.
43
- * A refrigerator is always defined via endpoint composition.
44
- * - Use `addCabinet` to add one or more cabinets to the refrigerator.
45
- */
46
10
  constructor(name, serial) {
47
11
  super([refrigerator, powerSource], { id: `${name.replaceAll(' ', '')}-${serial.replaceAll(' ', '')}` }, true);
48
12
  this.createDefaultIdentifyClusterServer();
@@ -50,35 +14,6 @@ export class Refrigerator extends MatterbridgeEndpoint {
50
14
  this.createDefaultPowerSourceWiredClusterServer();
51
15
  this.addFixedLabel('composed', 'Refrigerator');
52
16
  }
53
- /**
54
- * Adds a Level Temperature Controlled Cabinet Cooler to the refrigerator.
55
- *
56
- * @param {string} name - The name of the cabinet.
57
- * @param {Semtag[]} tagList - The tagList associated with the cabinet.
58
- * @param {number} currentMode - The current mode of the cabinet. Defaults to 1 (which corresponds to 'Auto').
59
- * @param {RefrigeratorAndTemperatureControlledCabinetMode.ModeOption[]} supportedModes - The supported modes for the cabinet. Defaults to 'Auto', 'RapidCool', and 'RapidFreeze'.
60
- * @param {number} selectedTemperatureLevel - The selected temperature level as an index of the supportedTemperatureLevels array. Defaults to 2 (which corresponds to 'Level 3').
61
- * @param {string[]} supportedTemperatureLevels - The list of supported temperature levels for the cabinet. Defaults to ['Level 1', 'Level 2', 'Level 3', 'Level 4', 'Level 5'].
62
- * @param {number} currentTemperature - The current temperature of the cabinet in degrees Celsius. Defaults to 1000 (which corresponds to 10.00 degrees Celsius).
63
- *
64
- * @returns {MatterbridgeEndpoint} The MatterbridgeEndpoint instance representing the cabinet.
65
- *
66
- * @remarks
67
- * 13.4.1 A Temperature Controlled Cabinet Cooler is a device that provides a cooled space for chilling food.
68
- * It is typically installed within a refrigerator.
69
- *
70
- * Example usage with specific namespace tags:
71
- * ```
72
- * refrigerator.addCabinet('Refrigerator Top', [
73
- * { mfgCode: null, namespaceId: PositionTag.Top.namespaceId, tag: PositionTag.Top.tag, label: 'Refrigerator Top' },
74
- * { mfgCode: null, namespaceId: RefrigeratorTag.Refrigerator.namespaceId, tag: RefrigeratorTag.Refrigerator.tag, label: RefrigeratorTag.Refrigerator.label },
75
- * ]);
76
- * refrigerator.addCabinet('Freezer Bottom', [
77
- * { mfgCode: null, namespaceId: PositionTag.Bottom.namespaceId, tag: PositionTag.Bottom.tag, label: 'Freezer Bottom' },
78
- * { mfgCode: null, namespaceId: RefrigeratorTag.Freezer.namespaceId, tag: RefrigeratorTag.Freezer.tag, label: RefrigeratorTag.Freezer.label },
79
- * ]);
80
- * ```
81
- */
82
17
  addCabinet(name, tagList, currentMode = 1, supportedModes = [
83
18
  { label: 'Auto', mode: 1, modeTags: [{ value: RefrigeratorAndTemperatureControlledCabinetMode.ModeTag.Auto }] },
84
19
  { label: 'RapidCool', mode: 2, modeTags: [{ value: RefrigeratorAndTemperatureControlledCabinetMode.ModeTag.RapidCool }] },
@@ -93,19 +28,6 @@ export class Refrigerator extends MatterbridgeEndpoint {
93
28
  cabinet.createDefaultTemperatureMeasurementClusterServer(currentTemperature);
94
29
  return cabinet;
95
30
  }
96
- /**
97
- * Creates a default RefrigeratorAndTemperatureControlledCabinetMode Cluster Server.
98
- *
99
- * @param {MatterbridgeEndpoint} endpoint - The Matterbridge endpoint instance.
100
- * @param {number} currentMode - The current mode of the oven.
101
- * @param {RefrigeratorAndTemperatureControlledCabinetMode.ModeOption[]} supportedModes - The supported modes for the refrigerator and temperature controlled cabinet.
102
- *
103
- * @returns {MatterbridgeEndpoint} The current MatterbridgeEndpoint instance for chaining.
104
- *
105
- * @remarks
106
- * - supportedModes is a fixed attribute. It cannot be changed at runtime.
107
- * - currentMode persists across reboots.
108
- */
109
31
  createDefaultRefrigeratorAndTemperatureControlledCabinetModeClusterServer(endpoint, currentMode, supportedModes) {
110
32
  endpoint.behaviors.require(MatterbridgeRefrigeratorAndTemperatureControlledCabinetModeServer, {
111
33
  supportedModes,
@@ -113,14 +35,6 @@ export class Refrigerator extends MatterbridgeEndpoint {
113
35
  });
114
36
  return endpoint;
115
37
  }
116
- /**
117
- * Creates a default RefrigeratorAlarm Cluster Server.
118
- *
119
- * @param {MatterbridgeEndpoint} endpoint - The Matterbridge endpoint instance.
120
- * @param {boolean} doorOpen - Indicates if the refrigerator door is open.
121
- *
122
- * @returns {MatterbridgeEndpoint} The updated MatterbridgeEndpoint instance.
123
- */
124
38
  createDefaultRefrigeratorAlarmClusterServer(endpoint, doorOpen = false) {
125
39
  endpoint.behaviors.require(RefrigeratorAlarmServer, {
126
40
  mask: { doorOpen: true },
@@ -129,13 +43,6 @@ export class Refrigerator extends MatterbridgeEndpoint {
129
43
  });
130
44
  return endpoint;
131
45
  }
132
- /**
133
- * Sets the door open state for a specific cabinet.
134
- *
135
- * @param {string} cabinetName - The name of the cabinet.
136
- * @param {boolean} doorOpen - Indicates if the door is open.
137
- * @returns {MatterbridgeEndpoint | undefined} The updated MatterbridgeEndpoint instance or undefined if not found.
138
- */
139
46
  async setDoorOpenState(cabinetName, doorOpen) {
140
47
  const endpoint = this.getChildEndpointByName(cabinetName);
141
48
  if (endpoint) {
@@ -143,13 +50,6 @@ export class Refrigerator extends MatterbridgeEndpoint {
143
50
  return endpoint;
144
51
  }
145
52
  }
146
- /**
147
- * Triggers the notify event for door open state on a specific cabinet.
148
- *
149
- * @param {string} cabinetName - The name of the cabinet.
150
- * @param {boolean} doorOpen - Indicates if the door is open.
151
- * @returns {MatterbridgeEndpoint | undefined} The updated MatterbridgeEndpoint instance or undefined if not found.
152
- */
153
53
  async triggerDoorOpenState(cabinetName, doorOpen) {
154
54
  const endpoint = this.getChildEndpointByName(cabinetName);
155
55
  if (endpoint) {
@@ -163,7 +63,6 @@ export class Refrigerator extends MatterbridgeEndpoint {
163
63
  }
164
64
  }
165
65
  }
166
- // Server for RefrigeratorAndTemperatureControlledCabinetMode
167
66
  export class MatterbridgeRefrigeratorAndTemperatureControlledCabinetModeServer extends RefrigeratorAndTemperatureControlledCabinetModeServer {
168
67
  initialize() {
169
68
  const device = this.endpoint.stateOf(MatterbridgeServer);
@@ -183,4 +82,3 @@ export class MatterbridgeRefrigeratorAndTemperatureControlledCabinetModeServer e
183
82
  }
184
83
  }
185
84
  }
186
- //# sourceMappingURL=refrigerator.js.map
@@ -1,26 +1,3 @@
1
- /**
2
- * @description This file contains the RoboticVacuumCleaner class.
3
- * @file src/devices/roboticVacuumCleaner.ts
4
- * @author Luca Liguori
5
- * @created 2025-05-01
6
- * @version 1.1.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
- // Matter.js
24
1
  import { AreaNamespaceTag } from '@matter/node';
25
2
  import { PowerSource } from '@matter/types/clusters/power-source';
26
3
  import { RvcRunMode } from '@matter/types/clusters/rvc-run-mode';
@@ -32,30 +9,10 @@ import { OperationalState } from '@matter/types/clusters/operational-state';
32
9
  import { RvcRunModeServer } from '@matter/node/behaviors/rvc-run-mode';
33
10
  import { RvcOperationalStateServer } from '@matter/node/behaviors/rvc-operational-state';
34
11
  import { RvcCleanModeServer } from '@matter/node/behaviors/rvc-clean-mode';
35
- // Matterbridge
36
12
  import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
37
13
  import { powerSource, roboticVacuumCleaner } from '../matterbridgeDeviceTypes.js';
38
14
  import { MatterbridgeServer, MatterbridgeServiceAreaServer } from '../matterbridgeBehaviors.js';
39
15
  export class RoboticVacuumCleaner extends MatterbridgeEndpoint {
40
- /**
41
- * Creates an instance of the RoboticVacuumCleaner class.
42
- *
43
- * @param {string} name - The name of the robotic vacuum cleaner.
44
- * @param {string} serial - The serial number of the robotic vacuum cleaner.
45
- * @param {'server' | 'matter' | undefined} [mode] - The mode of the robotic vacuum cleaner. Defaults to undefined. Use 'server' or 'matter' if you want Apple Home compatibility.
46
- * @param {number} [currentRunMode] - The current run mode of the robotic vacuum cleaner. Defaults to 1 (Idle).
47
- * @param {RvcRunMode.ModeOption[]} [supportedRunModes] - The supported run modes for the robotic vacuum cleaner. Defaults to a predefined set of modes.
48
- * @param {number} [currentCleanMode] - The current clean mode of the robotic vacuum cleaner. Defaults to 1 (Vacuum).
49
- * @param {RvcCleanMode.ModeOption[]} [supportedCleanModes] - The supported clean modes for the robotic vacuum cleaner. Defaults to a predefined set of modes.
50
- * @param {number | null} [currentPhase] - The current phase of the robotic vacuum cleaner. Defaults to null.
51
- * @param {string[] | null} [phaseList] - The list of phases for the robotic vacuum cleaner. Defaults to null.
52
- * @param {RvcOperationalState.OperationalState} [operationalState] - The current operational state of the robotic vacuum cleaner. Defaults to Docked.
53
- * @param {RvcOperationalState.OperationalStateStruct[]} [operationalStateList] - The list of operational states for the robotic vacuum cleaner. Defaults to a predefined set of states.
54
- * @param {ServiceArea.Area[]} [supportedAreas] - The supported areas for the robotic vacuum cleaner. Defaults to a predefined set of areas.
55
- * @param {number[]} [selectedAreas] - The selected areas for the robotic vacuum cleaner. Defaults to an empty array (all areas allowed).
56
- * @param {number} [currentArea] - The current area of the robotic vacuum cleaner. Defaults to 1 (Living).
57
- * @param {ServiceArea.Map[]} [supportedMaps] - The supported maps for the robotic vacuum cleaner. Defaults to empty list.
58
- */
59
16
  constructor(name, serial, mode = undefined, currentRunMode, supportedRunModes, currentCleanMode, supportedCleanModes, currentPhase = null, phaseList = null, operationalState, operationalStateList, supportedAreas, selectedAreas, currentArea, supportedMaps) {
60
17
  super([roboticVacuumCleaner, powerSource], { id: `${name.replaceAll(' ', '')}-${serial.replaceAll(' ', '')}`, mode });
61
18
  this.createDefaultIdentifyClusterServer()
@@ -66,17 +23,6 @@ export class RoboticVacuumCleaner extends MatterbridgeEndpoint {
66
23
  .createDefaultRvcOperationalStateClusterServer(phaseList, currentPhase, operationalStateList, operationalState)
67
24
  .createDefaultServiceAreaClusterServer(supportedAreas, selectedAreas, currentArea, supportedMaps);
68
25
  }
69
- /**
70
- * Creates a default RvcRunMode Cluster Server.
71
- *
72
- * @param {number} [currentMode] - The current mode of the RvcRunMode cluster. Defaults to 1 (Idle).
73
- * @param {RvcRunMode.ModeOption[]} [supportedModes] - The supported modes for the RvcRunMode cluster. Defaults to a predefined set of modes.
74
- *
75
- * @returns {this} The current MatterbridgeEndpoint instance for chaining.
76
- *
77
- * @remarks
78
- * - supportedModes is a fixed attribute that defines the run modes available for the robotic vacuum cleaner.
79
- */
80
26
  createDefaultRvcRunModeClusterServer(currentMode, supportedModes) {
81
27
  this.behaviors.require(MatterbridgeRvcRunModeServer, {
82
28
  supportedModes: supportedModes ?? [
@@ -89,17 +35,6 @@ export class RoboticVacuumCleaner extends MatterbridgeEndpoint {
89
35
  });
90
36
  return this;
91
37
  }
92
- /**
93
- * Creates a default RvcCleanMode Cluster Server.
94
- *
95
- * @param {number} [currentMode] - The current mode of the RvcCleanMode cluster. Defaults to 1 (Vacuum).
96
- * @param {RvcCleanMode.ModeOption[]} [supportedModes] - The supported modes for the RvcCleanMode cluster. Defaults to a predefined set of modes.
97
- *
98
- * @returns {this} The current MatterbridgeEndpoint instance for chaining.
99
- *
100
- * @remarks
101
- * - supportedModes is a fixed attribute that defines the clean modes available for the robotic vacuum cleaner.
102
- */
103
38
  createDefaultRvcCleanModeClusterServer(currentMode, supportedModes) {
104
39
  this.behaviors.require(MatterbridgeRvcCleanModeServer, {
105
40
  supportedModes: supportedModes ?? [
@@ -111,15 +46,6 @@ export class RoboticVacuumCleaner extends MatterbridgeEndpoint {
111
46
  });
112
47
  return this;
113
48
  }
114
- /**
115
- * Creates a default ServiceArea Cluster Server.
116
- *
117
- * @param {ServiceArea.Area[]} [supportedAreas] - The supported areas for the ServiceArea cluster. Defaults to a predefined set of areas.
118
- * @param {number[]} [selectedAreas] - The selected areas for the ServiceArea cluster. Defaults to an empty array (all areas allowed).
119
- * @param {number} [currentArea] - The current areaId (not the index in the array!) of the ServiceArea cluster. Defaults to 1 (Living).
120
- * @param {ServiceArea.Map[]} [supportedMaps] - The supported maps for the robotic vacuum cleaner. Defaults empty list.
121
- * @returns {this} The current MatterbridgeEndpoint instance for chaining.
122
- */
123
49
  createDefaultServiceAreaClusterServer(supportedAreas, selectedAreas, currentArea, supportedMaps) {
124
50
  this.behaviors.require(MatterbridgeServiceAreaServer.with(ServiceArea.Feature.Maps), {
125
51
  supportedAreas: supportedAreas ?? [
@@ -144,28 +70,13 @@ export class RoboticVacuumCleaner extends MatterbridgeEndpoint {
144
70
  areaInfo: { locationInfo: { locationName: 'Bathroom', floorNumber: 1, areaType: AreaNamespaceTag.Bathroom.tag }, landmarkInfo: null },
145
71
  },
146
72
  ],
147
- selectedAreas: selectedAreas ?? [], // Indicates the set of areas where the device SHOULD attempt to operate. If this attribute is empty, the device is not constrained to operate in any specific areas.
148
- currentArea: currentArea ?? 1, // If not null, the value of this attribute shall match the AreaID field of an entry on the SupportedAreas attribute’s list. A null value indicates that the device is currently unable to provide this information.
149
- supportedMaps: supportedMaps ?? [], // If empty, that indicates that the device is currently unable to provide this information
150
- /**
151
- * Indicates the estimated Epoch time for completing operating at the area indicated by the CurrentArea attribute, in seconds. A value of 0 means that the operation has completed.
152
- * When this attribute is null, that represents that there is no time currently defined until operation completion.
153
- * This attribute SHALL be null if the CurrentArea attribute is null.
154
- */
73
+ selectedAreas: selectedAreas ?? [],
74
+ currentArea: currentArea ?? 1,
75
+ supportedMaps: supportedMaps ?? [],
155
76
  estimatedEndTime: null,
156
77
  });
157
78
  return this;
158
79
  }
159
- /**
160
- * Creates a default RvcOperationalState Cluster Server.
161
- *
162
- * @param {string[] | null} [phaseList] - The list of phases for the RvcOperationalState cluster. Defaults to null.
163
- * @param {number | null} [currentPhase] - The current phase (the index of the phaseList) of the RvcOperationalState cluster. Defaults to null.
164
- * @param {RvcOperationalState.OperationalStateStruct[]} [operationalStateList] - The list of operational states for the RvcOperationalState cluster. Defaults to a predefined set of states.
165
- * @param {RvcOperationalState.OperationalState} [operationalState] - The current operationalStateId of the RvcOperationalState cluster. Defaults to Docked.
166
- * @param {RvcOperationalState.ErrorStateStruct} [operationalError] - The current operational error of the RvcOperationalState cluster. Defaults to NoError.
167
- * @returns {this} The current MatterbridgeEndpoint instance for chaining.
168
- */
169
80
  createDefaultRvcOperationalStateClusterServer(phaseList = null, currentPhase = null, operationalStateList, operationalState, operationalError) {
170
81
  this.behaviors.require(MatterbridgeRvcOperationalStateServer, {
171
82
  phaseList,
@@ -175,9 +86,9 @@ export class RoboticVacuumCleaner extends MatterbridgeEndpoint {
175
86
  { operationalStateId: RvcOperationalState.OperationalState.Running },
176
87
  { operationalStateId: RvcOperationalState.OperationalState.Paused },
177
88
  { operationalStateId: RvcOperationalState.OperationalState.Error },
178
- { operationalStateId: RvcOperationalState.OperationalState.SeekingCharger }, // Y RVC Pause Compatibility N RVC Resume Compatibility
179
- { operationalStateId: RvcOperationalState.OperationalState.Charging }, // N RVC Pause Compatibility Y RVC Resume Compatibility
180
- { operationalStateId: RvcOperationalState.OperationalState.Docked }, // N RVC Pause Compatibility Y RVC Resume Compatibility
89
+ { operationalStateId: RvcOperationalState.OperationalState.SeekingCharger },
90
+ { operationalStateId: RvcOperationalState.OperationalState.Charging },
91
+ { operationalStateId: RvcOperationalState.OperationalState.Docked },
181
92
  ],
182
93
  operationalState: operationalState ?? RvcOperationalState.OperationalState.Docked,
183
94
  operationalError: operationalError ?? { errorStateId: RvcOperationalState.ErrorState.NoError, errorStateDetails: 'Fully operational' },
@@ -232,7 +143,7 @@ export class MatterbridgeRvcOperationalStateServer extends RvcOperationalStateSe
232
143
  device.log.info(`Pause (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
233
144
  device.commandHandler.executeHandler('pause', { request: {}, cluster: RvcOperationalStateServer.id, attributes: this.state, endpoint: this.endpoint });
234
145
  device.log.debug('MatterbridgeRvcOperationalStateServer: pause called setting operational state to Paused and currentMode to Idle');
235
- this.agent.get(MatterbridgeRvcRunModeServer).state.currentMode = 1; // RvcRunMode.ModeTag.Idle
146
+ this.agent.get(MatterbridgeRvcRunModeServer).state.currentMode = 1;
236
147
  this.state.operationalState = RvcOperationalState.OperationalState.Paused;
237
148
  this.state.operationalError = { errorStateId: RvcOperationalState.ErrorState.NoError, errorStateDetails: 'Fully operational' };
238
149
  return {
@@ -244,7 +155,7 @@ export class MatterbridgeRvcOperationalStateServer extends RvcOperationalStateSe
244
155
  device.log.info(`Resume (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
245
156
  device.commandHandler.executeHandler('resume', { request: {}, cluster: RvcOperationalStateServer.id, attributes: this.state, endpoint: this.endpoint });
246
157
  device.log.debug('MatterbridgeRvcOperationalStateServer: resume called setting operational state to Running and currentMode to Cleaning');
247
- this.agent.get(MatterbridgeRvcRunModeServer).state.currentMode = 2; // RvcRunMode.ModeTag.Cleaning
158
+ this.agent.get(MatterbridgeRvcRunModeServer).state.currentMode = 2;
248
159
  this.state.operationalState = RvcOperationalState.OperationalState.Running;
249
160
  this.state.operationalError = { errorStateId: RvcOperationalState.ErrorState.NoError, errorStateDetails: 'Fully operational' };
250
161
  return {
@@ -252,12 +163,11 @@ export class MatterbridgeRvcOperationalStateServer extends RvcOperationalStateSe
252
163
  };
253
164
  }
254
165
  goHome() {
255
- // const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
256
166
  const device = this.endpoint.stateOf(MatterbridgeServer);
257
167
  device.log.info(`GoHome (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
258
168
  device.commandHandler.executeHandler('goHome', { request: {}, cluster: RvcOperationalStateServer.id, attributes: this.state, endpoint: this.endpoint });
259
169
  device.log.debug('MatterbridgeRvcOperationalStateServer: goHome called setting operational state to Docked and currentMode to Idle');
260
- this.agent.get(MatterbridgeRvcRunModeServer).state.currentMode = 1; // RvcRunMode.ModeTag.Idle
170
+ this.agent.get(MatterbridgeRvcRunModeServer).state.currentMode = 1;
261
171
  this.state.operationalState = RvcOperationalState.OperationalState.Docked;
262
172
  this.state.operationalError = { errorStateId: RvcOperationalState.ErrorState.NoError, errorStateDetails: 'Fully operational' };
263
173
  return {
@@ -265,4 +175,3 @@ export class MatterbridgeRvcOperationalStateServer extends RvcOperationalStateSe
265
175
  };
266
176
  }
267
177
  }
268
- //# sourceMappingURL=roboticVacuumCleaner.js.map
@@ -1,45 +1,8 @@
1
- /**
2
- * @description This file contains the SolarPower class.
3
- * @file src/devices/solarPower.ts
4
- * @author Luca Liguori
5
- * @contributor Ludovic BOUÉ
6
- * @created 2025-06-14
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
- // Matterbridge
28
3
  import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
29
4
  import { deviceEnergyManagement, electricalSensor, solarPower, powerSource } from '../matterbridgeDeviceTypes.js';
30
5
  export class SolarPower extends MatterbridgeEndpoint {
31
- /**
32
- * Creates an instance of the SolarPower class.
33
- *
34
- * @param {string} name - The name of the SolarPower.
35
- * @param {string} serial - The serial number of the SolarPower.
36
- * @param {number} voltage - The voltage value in millivolts.
37
- * @param {number} current - The current value in milliamperes.
38
- * @param {number} power - The power value in milliwatts.
39
- * @param {number} energyExported - The total production value in mW/h.
40
- * @param {number} [absMinPower] - Indicate the minimum electrical power in mw that the ESA can consume when switched on. Defaults to `0` if not provided.
41
- * @param {number} [absMaxPower] - Indicate the maximum electrical power in mw that the ESA can consume when switched on. Defaults to `0` if not provided.
42
- */
43
6
  constructor(name, serial, voltage = null, current = null, power = null, energyExported = null, absMinPower = 0, absMaxPower = 0) {
44
7
  super([solarPower, powerSource, electricalSensor, deviceEnergyManagement], {
45
8
  tagList: [{ mfgCode: null, namespaceId: PowerSourceTag.Solar.namespaceId, tag: PowerSourceTag.Solar.tag, label: null }],
@@ -56,4 +19,3 @@ export class SolarPower extends MatterbridgeEndpoint {
56
19
  .addRequiredClusterServers();
57
20
  }
58
21
  }
59
- //# sourceMappingURL=solarPower.js.map
@@ -1,60 +1,9 @@
1
- /**
2
- * @description Speaker device class controlling mute (On/Off) and volume level (Level Control).
3
- * @file src/devices/speaker.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
- // matter clusters
24
1
  import { OnOff } from '@matter/types/clusters/on-off';
25
2
  import { LevelControl } from '@matter/types/clusters/level-control';
26
- // matterbridge
27
3
  import { speakerDevice } from '../matterbridgeDeviceTypes.js';
28
4
  import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
29
- /**
30
- * Represents a Speaker endpoint (Device Type 0x0022) exposing mute (OnOff) and volume (LevelControl).
31
- *
32
- * Mapping:
33
- * - OnOff TRUE => audio unmuted
34
- * - OnOff FALSE => audio muted
35
- * - LevelControl.currentLevel (1..254) => volume (linear map to 0..100%)
36
- *
37
- * Edge cases:
38
- * - Volume < 1 coerced to 1.
39
- * - Volume > 254 coerced to 254.
40
- * - Non‑finite volume falls back to 128 (≈ mid level).
41
- */
42
5
  export class Speaker extends MatterbridgeEndpoint {
43
- /**
44
- * Create Speaker endpoint.
45
- *
46
- * @param {string} name Human readable device name.
47
- * @param {string} serial Unique serial (used to derive storage key).
48
- * @param {boolean} muted Initial muted state (true => unmuted, default true if omitted).
49
- * @param {number} volume Initial volume (1..254, coerced; default 128 ≈ 50% if omitted).
50
- * @returns {Speaker} New speaker instance.
51
- *
52
- * @remarks Supported by:
53
- * - SmartThings (OnOff mute, LevelControl volume)
54
- * - Google Home (OnOff mute, LevelControl volume)
55
- */
56
6
  constructor(name, serial, muted = false, volume = 128) {
57
- // sanitize volume
58
7
  if (!Number.isFinite(volume))
59
8
  volume = 128;
60
9
  if (volume < 1)
@@ -63,42 +12,15 @@ export class Speaker extends MatterbridgeEndpoint {
63
12
  volume = 254;
64
13
  super([speakerDevice], { id: `${name.replaceAll(' ', '')}-${serial.replaceAll(' ', '')}` });
65
14
  this.createDefaultBasicInformationClusterServer(name, serial, 0xfff1, 'Matterbridge', 0x8000, 'Matterbridge Speaker');
66
- // On/Off used for mute state (TRUE => unmuted) - using no features
67
15
  this.createOnOffClusterServer(!muted);
68
- // LevelControl for volume - using no features
69
16
  this.createLevelControlClusterServer(volume);
70
17
  }
71
- /**
72
- * Set mute state (true => muted / audio off).
73
- *
74
- * Edge cases:
75
- * - Strict boolean; caller must pass boolean (TS enforces).
76
- *
77
- * @param {boolean} muted Desired mute state (true => muted, false => unmuted).
78
- * @returns {Promise<void>} Resolves when attribute is updated.
79
- */
80
18
  async setMuted(muted) {
81
19
  await this.setAttribute(OnOff.Cluster.id, 'onOff', !muted);
82
20
  }
83
- /**
84
- * Get mute state.
85
- *
86
- * @returns {boolean} TRUE when muted, FALSE when unmuted.
87
- */
88
21
  isMuted() {
89
22
  return !this.getAttribute(OnOff.Cluster.id, 'onOff');
90
23
  }
91
- /**
92
- * Set volume level (1..254).
93
- *
94
- * Edge cases:
95
- * - Non‑finite input ignored.
96
- * - <1 coerced to 1.
97
- * - >254 coerced to 254.
98
- *
99
- * @param {number} level Raw level (1..254 recommended, coerced if outside range).
100
- * @returns {Promise<void>} Resolves when attribute is updated.
101
- */
102
24
  async setVolume(level) {
103
25
  if (!Number.isFinite(level))
104
26
  return;
@@ -108,13 +30,7 @@ export class Speaker extends MatterbridgeEndpoint {
108
30
  level = 254;
109
31
  await this.setAttribute(LevelControl.Cluster.id, 'currentLevel', level);
110
32
  }
111
- /**
112
- * Get current volume.
113
- *
114
- * @returns {number} Current level (1..254).
115
- */
116
33
  getVolume() {
117
34
  return this.getAttribute(LevelControl.Cluster.id, 'currentLevel');
118
35
  }
119
36
  }
120
- //# sourceMappingURL=speaker.js.map