matterbridge 3.4.3-dev-20251209-e6cb85f → 3.4.3

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 (324) hide show
  1. package/README.md +2 -3
  2. package/dist/broadcastServer.d.ts +144 -0
  3. package/dist/broadcastServer.d.ts.map +1 -0
  4. package/dist/broadcastServer.js +119 -0
  5. package/dist/broadcastServer.js.map +1 -0
  6. package/dist/broadcastServerTypes.d.ts +841 -0
  7. package/dist/broadcastServerTypes.d.ts.map +1 -0
  8. package/dist/broadcastServerTypes.js +24 -0
  9. package/dist/broadcastServerTypes.js.map +1 -0
  10. package/dist/cli.d.ts +30 -0
  11. package/dist/cli.d.ts.map +1 -0
  12. package/dist/cli.js +97 -1
  13. package/dist/cli.js.map +1 -0
  14. package/dist/cliEmitter.d.ts +50 -0
  15. package/dist/cliEmitter.d.ts.map +1 -0
  16. package/dist/cliEmitter.js +37 -0
  17. package/dist/cliEmitter.js.map +1 -0
  18. package/dist/cliHistory.d.ts +48 -0
  19. package/dist/cliHistory.d.ts.map +1 -0
  20. package/dist/cliHistory.js +38 -0
  21. package/dist/cliHistory.js.map +1 -0
  22. package/dist/clusters/export.d.ts +2 -0
  23. package/dist/clusters/export.d.ts.map +1 -0
  24. package/dist/clusters/export.js +2 -0
  25. package/dist/clusters/export.js.map +1 -0
  26. package/dist/deviceManager.d.ts +135 -0
  27. package/dist/deviceManager.d.ts.map +1 -0
  28. package/dist/deviceManager.js +113 -1
  29. package/dist/deviceManager.js.map +1 -0
  30. package/dist/devices/airConditioner.d.ts +98 -0
  31. package/dist/devices/airConditioner.d.ts.map +1 -0
  32. package/dist/devices/airConditioner.js +57 -0
  33. package/dist/devices/airConditioner.js.map +1 -0
  34. package/dist/devices/batteryStorage.d.ts +48 -0
  35. package/dist/devices/batteryStorage.d.ts.map +1 -0
  36. package/dist/devices/batteryStorage.js +48 -1
  37. package/dist/devices/batteryStorage.js.map +1 -0
  38. package/dist/devices/cooktop.d.ts +61 -0
  39. package/dist/devices/cooktop.d.ts.map +1 -0
  40. package/dist/devices/cooktop.js +56 -0
  41. package/dist/devices/cooktop.js.map +1 -0
  42. package/dist/devices/dishwasher.d.ts +71 -0
  43. package/dist/devices/dishwasher.d.ts.map +1 -0
  44. package/dist/devices/dishwasher.js +57 -0
  45. package/dist/devices/dishwasher.js.map +1 -0
  46. package/dist/devices/evse.d.ts +76 -0
  47. package/dist/devices/evse.d.ts.map +1 -0
  48. package/dist/devices/evse.js +74 -10
  49. package/dist/devices/evse.js.map +1 -0
  50. package/dist/devices/export.d.ts +17 -0
  51. package/dist/devices/export.d.ts.map +1 -0
  52. package/dist/devices/export.js +5 -0
  53. package/dist/devices/export.js.map +1 -0
  54. package/dist/devices/extractorHood.d.ts +46 -0
  55. package/dist/devices/extractorHood.d.ts.map +1 -0
  56. package/dist/devices/extractorHood.js +43 -0
  57. package/dist/devices/extractorHood.js.map +1 -0
  58. package/dist/devices/heatPump.d.ts +47 -0
  59. package/dist/devices/heatPump.d.ts.map +1 -0
  60. package/dist/devices/heatPump.js +50 -2
  61. package/dist/devices/heatPump.js.map +1 -0
  62. package/dist/devices/laundryDryer.d.ts +67 -0
  63. package/dist/devices/laundryDryer.d.ts.map +1 -0
  64. package/dist/devices/laundryDryer.js +62 -3
  65. package/dist/devices/laundryDryer.js.map +1 -0
  66. package/dist/devices/laundryWasher.d.ts +81 -0
  67. package/dist/devices/laundryWasher.d.ts.map +1 -0
  68. package/dist/devices/laundryWasher.js +70 -4
  69. package/dist/devices/laundryWasher.js.map +1 -0
  70. package/dist/devices/microwaveOven.d.ts +168 -0
  71. package/dist/devices/microwaveOven.d.ts.map +1 -0
  72. package/dist/devices/microwaveOven.js +88 -5
  73. package/dist/devices/microwaveOven.js.map +1 -0
  74. package/dist/devices/oven.d.ts +105 -0
  75. package/dist/devices/oven.d.ts.map +1 -0
  76. package/dist/devices/oven.js +85 -0
  77. package/dist/devices/oven.js.map +1 -0
  78. package/dist/devices/refrigerator.d.ts +118 -0
  79. package/dist/devices/refrigerator.d.ts.map +1 -0
  80. package/dist/devices/refrigerator.js +102 -0
  81. package/dist/devices/refrigerator.js.map +1 -0
  82. package/dist/devices/roboticVacuumCleaner.d.ts +112 -0
  83. package/dist/devices/roboticVacuumCleaner.d.ts.map +1 -0
  84. package/dist/devices/roboticVacuumCleaner.js +100 -9
  85. package/dist/devices/roboticVacuumCleaner.js.map +1 -0
  86. package/dist/devices/solarPower.d.ts +40 -0
  87. package/dist/devices/solarPower.d.ts.map +1 -0
  88. package/dist/devices/solarPower.js +38 -0
  89. package/dist/devices/solarPower.js.map +1 -0
  90. package/dist/devices/speaker.d.ts +87 -0
  91. package/dist/devices/speaker.d.ts.map +1 -0
  92. package/dist/devices/speaker.js +84 -0
  93. package/dist/devices/speaker.js.map +1 -0
  94. package/dist/devices/temperatureControl.d.ts +166 -0
  95. package/dist/devices/temperatureControl.d.ts.map +1 -0
  96. package/dist/devices/temperatureControl.js +24 -3
  97. package/dist/devices/temperatureControl.js.map +1 -0
  98. package/dist/devices/waterHeater.d.ts +111 -0
  99. package/dist/devices/waterHeater.d.ts.map +1 -0
  100. package/dist/devices/waterHeater.js +82 -2
  101. package/dist/devices/waterHeater.js.map +1 -0
  102. package/dist/dgram/coap.d.ts +205 -0
  103. package/dist/dgram/coap.d.ts.map +1 -0
  104. package/dist/dgram/coap.js +126 -13
  105. package/dist/dgram/coap.js.map +1 -0
  106. package/dist/dgram/dgram.d.ts +141 -0
  107. package/dist/dgram/dgram.d.ts.map +1 -0
  108. package/dist/dgram/dgram.js +114 -2
  109. package/dist/dgram/dgram.js.map +1 -0
  110. package/dist/dgram/mb_coap.d.ts +24 -0
  111. package/dist/dgram/mb_coap.d.ts.map +1 -0
  112. package/dist/dgram/mb_coap.js +41 -3
  113. package/dist/dgram/mb_coap.js.map +1 -0
  114. package/dist/dgram/mb_mdns.d.ts +24 -0
  115. package/dist/dgram/mb_mdns.d.ts.map +1 -0
  116. package/dist/dgram/mb_mdns.js +80 -15
  117. package/dist/dgram/mb_mdns.js.map +1 -0
  118. package/dist/dgram/mdns.d.ts +290 -0
  119. package/dist/dgram/mdns.d.ts.map +1 -0
  120. package/dist/dgram/mdns.js +299 -137
  121. package/dist/dgram/mdns.js.map +1 -0
  122. package/dist/dgram/multicast.d.ts +67 -0
  123. package/dist/dgram/multicast.d.ts.map +1 -0
  124. package/dist/dgram/multicast.js +62 -1
  125. package/dist/dgram/multicast.js.map +1 -0
  126. package/dist/dgram/unicast.d.ts +56 -0
  127. package/dist/dgram/unicast.d.ts.map +1 -0
  128. package/dist/dgram/unicast.js +54 -0
  129. package/dist/dgram/unicast.js.map +1 -0
  130. package/dist/frontend.d.ts +238 -0
  131. package/dist/frontend.d.ts.map +1 -0
  132. package/dist/frontend.js +455 -35
  133. package/dist/frontend.js.map +1 -0
  134. package/dist/frontendTypes.d.ts +529 -0
  135. package/dist/frontendTypes.d.ts.map +1 -0
  136. package/dist/frontendTypes.js +45 -0
  137. package/dist/frontendTypes.js.map +1 -0
  138. package/dist/helpers.d.ts +48 -0
  139. package/dist/helpers.d.ts.map +1 -0
  140. package/dist/helpers.js +53 -0
  141. package/dist/helpers.js.map +1 -0
  142. package/dist/index.d.ts +34 -0
  143. package/dist/index.d.ts.map +1 -0
  144. package/dist/index.js +25 -0
  145. package/dist/index.js.map +1 -0
  146. package/dist/jestutils/export.d.ts +2 -0
  147. package/dist/jestutils/export.d.ts.map +1 -0
  148. package/dist/jestutils/export.js +1 -0
  149. package/dist/jestutils/export.js.map +1 -0
  150. package/dist/jestutils/jestHelpers.d.ts +345 -0
  151. package/dist/jestutils/jestHelpers.d.ts.map +1 -0
  152. package/dist/jestutils/jestHelpers.js +371 -14
  153. package/dist/jestutils/jestHelpers.js.map +1 -0
  154. package/dist/logger/export.d.ts +2 -0
  155. package/dist/logger/export.d.ts.map +1 -0
  156. package/dist/logger/export.js +1 -0
  157. package/dist/logger/export.js.map +1 -0
  158. package/dist/matter/behaviors.d.ts +2 -0
  159. package/dist/matter/behaviors.d.ts.map +1 -0
  160. package/dist/matter/behaviors.js +2 -0
  161. package/dist/matter/behaviors.js.map +1 -0
  162. package/dist/matter/clusters.d.ts +2 -0
  163. package/dist/matter/clusters.d.ts.map +1 -0
  164. package/dist/matter/clusters.js +2 -0
  165. package/dist/matter/clusters.js.map +1 -0
  166. package/dist/matter/devices.d.ts +2 -0
  167. package/dist/matter/devices.d.ts.map +1 -0
  168. package/dist/matter/devices.js +2 -0
  169. package/dist/matter/devices.js.map +1 -0
  170. package/dist/matter/endpoints.d.ts +2 -0
  171. package/dist/matter/endpoints.d.ts.map +1 -0
  172. package/dist/matter/endpoints.js +2 -0
  173. package/dist/matter/endpoints.js.map +1 -0
  174. package/dist/matter/export.d.ts +5 -0
  175. package/dist/matter/export.d.ts.map +1 -0
  176. package/dist/matter/export.js +3 -0
  177. package/dist/matter/export.js.map +1 -0
  178. package/dist/matter/types.d.ts +3 -0
  179. package/dist/matter/types.d.ts.map +1 -0
  180. package/dist/matter/types.js +3 -0
  181. package/dist/matter/types.js.map +1 -0
  182. package/dist/matterNode.d.ts +342 -0
  183. package/dist/matterNode.d.ts.map +1 -0
  184. package/dist/matterNode.js +369 -8
  185. package/dist/matterNode.js.map +1 -0
  186. package/dist/matterbridge.d.ts +492 -0
  187. package/dist/matterbridge.d.ts.map +1 -0
  188. package/dist/matterbridge.js +811 -46
  189. package/dist/matterbridge.js.map +1 -0
  190. package/dist/matterbridgeAccessoryPlatform.d.ts +41 -0
  191. package/dist/matterbridgeAccessoryPlatform.d.ts.map +1 -0
  192. package/dist/matterbridgeAccessoryPlatform.js +38 -0
  193. package/dist/matterbridgeAccessoryPlatform.js.map +1 -0
  194. package/dist/matterbridgeBehaviors.d.ts +2404 -0
  195. package/dist/matterbridgeBehaviors.d.ts.map +1 -0
  196. package/dist/matterbridgeBehaviors.js +68 -5
  197. package/dist/matterbridgeBehaviors.js.map +1 -0
  198. package/dist/matterbridgeDeviceTypes.d.ts +698 -0
  199. package/dist/matterbridgeDeviceTypes.d.ts.map +1 -0
  200. package/dist/matterbridgeDeviceTypes.js +635 -14
  201. package/dist/matterbridgeDeviceTypes.js.map +1 -0
  202. package/dist/matterbridgeDynamicPlatform.d.ts +41 -0
  203. package/dist/matterbridgeDynamicPlatform.d.ts.map +1 -0
  204. package/dist/matterbridgeDynamicPlatform.js +38 -0
  205. package/dist/matterbridgeDynamicPlatform.js.map +1 -0
  206. package/dist/matterbridgeEndpoint.d.ts +1507 -0
  207. package/dist/matterbridgeEndpoint.d.ts.map +1 -0
  208. package/dist/matterbridgeEndpoint.js +1444 -53
  209. package/dist/matterbridgeEndpoint.js.map +1 -0
  210. package/dist/matterbridgeEndpointHelpers.d.ts +787 -0
  211. package/dist/matterbridgeEndpointHelpers.d.ts.map +1 -0
  212. package/dist/matterbridgeEndpointHelpers.js +483 -20
  213. package/dist/matterbridgeEndpointHelpers.js.map +1 -0
  214. package/dist/matterbridgeEndpointTypes.d.ts +166 -0
  215. package/dist/matterbridgeEndpointTypes.d.ts.map +1 -0
  216. package/dist/matterbridgeEndpointTypes.js +25 -0
  217. package/dist/matterbridgeEndpointTypes.js.map +1 -0
  218. package/dist/matterbridgePlatform.d.ts +539 -0
  219. package/dist/matterbridgePlatform.d.ts.map +1 -0
  220. package/dist/matterbridgePlatform.js +451 -1
  221. package/dist/matterbridgePlatform.js.map +1 -0
  222. package/dist/matterbridgeTypes.d.ts +251 -0
  223. package/dist/matterbridgeTypes.d.ts.map +1 -0
  224. package/dist/matterbridgeTypes.js +26 -0
  225. package/dist/matterbridgeTypes.js.map +1 -0
  226. package/dist/pluginManager.d.ts +372 -0
  227. package/dist/pluginManager.d.ts.map +1 -0
  228. package/dist/pluginManager.js +341 -5
  229. package/dist/pluginManager.js.map +1 -0
  230. package/dist/shelly.d.ts +181 -0
  231. package/dist/shelly.d.ts.map +1 -0
  232. package/dist/shelly.js +178 -7
  233. package/dist/shelly.js.map +1 -0
  234. package/dist/storage/export.d.ts +2 -0
  235. package/dist/storage/export.d.ts.map +1 -0
  236. package/dist/storage/export.js +1 -0
  237. package/dist/storage/export.js.map +1 -0
  238. package/dist/update.d.ts +84 -0
  239. package/dist/update.d.ts.map +1 -0
  240. package/dist/update.js +93 -1
  241. package/dist/update.js.map +1 -0
  242. package/dist/utils/colorUtils.d.ts +101 -0
  243. package/dist/utils/colorUtils.d.ts.map +1 -0
  244. package/dist/utils/colorUtils.js +97 -2
  245. package/dist/utils/colorUtils.js.map +1 -0
  246. package/dist/utils/commandLine.d.ts +66 -0
  247. package/dist/utils/commandLine.d.ts.map +1 -0
  248. package/dist/utils/commandLine.js +60 -0
  249. package/dist/utils/commandLine.js.map +1 -0
  250. package/dist/utils/copyDirectory.d.ts +35 -0
  251. package/dist/utils/copyDirectory.d.ts.map +1 -0
  252. package/dist/utils/copyDirectory.js +37 -0
  253. package/dist/utils/copyDirectory.js.map +1 -0
  254. package/dist/utils/createDirectory.d.ts +34 -0
  255. package/dist/utils/createDirectory.d.ts.map +1 -0
  256. package/dist/utils/createDirectory.js +33 -0
  257. package/dist/utils/createDirectory.js.map +1 -0
  258. package/dist/utils/createZip.d.ts +39 -0
  259. package/dist/utils/createZip.d.ts.map +1 -0
  260. package/dist/utils/createZip.js +47 -2
  261. package/dist/utils/createZip.js.map +1 -0
  262. package/dist/utils/deepCopy.d.ts +32 -0
  263. package/dist/utils/deepCopy.d.ts.map +1 -0
  264. package/dist/utils/deepCopy.js +39 -0
  265. package/dist/utils/deepCopy.js.map +1 -0
  266. package/dist/utils/deepEqual.d.ts +54 -0
  267. package/dist/utils/deepEqual.d.ts.map +1 -0
  268. package/dist/utils/deepEqual.js +72 -1
  269. package/dist/utils/deepEqual.js.map +1 -0
  270. package/dist/utils/error.d.ts +45 -0
  271. package/dist/utils/error.d.ts.map +1 -0
  272. package/dist/utils/error.js +42 -0
  273. package/dist/utils/error.js.map +1 -0
  274. package/dist/utils/export.d.ts +13 -0
  275. package/dist/utils/export.d.ts.map +1 -0
  276. package/dist/utils/export.js +1 -0
  277. package/dist/utils/export.js.map +1 -0
  278. package/dist/utils/format.d.ts +53 -0
  279. package/dist/utils/format.d.ts.map +1 -0
  280. package/dist/utils/format.js +49 -0
  281. package/dist/utils/format.js.map +1 -0
  282. package/dist/utils/hex.d.ts +89 -0
  283. package/dist/utils/hex.d.ts.map +1 -0
  284. package/dist/utils/hex.js +124 -0
  285. package/dist/utils/hex.js.map +1 -0
  286. package/dist/utils/inspector.d.ts +87 -0
  287. package/dist/utils/inspector.d.ts.map +1 -0
  288. package/dist/utils/inspector.js +69 -1
  289. package/dist/utils/inspector.js.map +1 -0
  290. package/dist/utils/isvalid.d.ts +103 -0
  291. package/dist/utils/isvalid.d.ts.map +1 -0
  292. package/dist/utils/isvalid.js +101 -0
  293. package/dist/utils/isvalid.js.map +1 -0
  294. package/dist/utils/network.d.ts +111 -0
  295. package/dist/utils/network.d.ts.map +1 -0
  296. package/dist/utils/network.js +96 -5
  297. package/dist/utils/network.js.map +1 -0
  298. package/dist/utils/spawn.d.ts +33 -0
  299. package/dist/utils/spawn.d.ts.map +1 -0
  300. package/dist/utils/spawn.js +71 -1
  301. package/dist/utils/spawn.js.map +1 -0
  302. package/dist/utils/tracker.d.ts +108 -0
  303. package/dist/utils/tracker.d.ts.map +1 -0
  304. package/dist/utils/tracker.js +64 -1
  305. package/dist/utils/tracker.js.map +1 -0
  306. package/dist/utils/wait.d.ts +54 -0
  307. package/dist/utils/wait.d.ts.map +1 -0
  308. package/dist/utils/wait.js +60 -8
  309. package/dist/utils/wait.js.map +1 -0
  310. package/dist/workerGlobalPrefix.d.ts +25 -0
  311. package/dist/workerGlobalPrefix.d.ts.map +1 -0
  312. package/dist/workerGlobalPrefix.js +37 -5
  313. package/dist/workerGlobalPrefix.js.map +1 -0
  314. package/dist/workerTypes.d.ts +52 -0
  315. package/dist/workerTypes.d.ts.map +1 -0
  316. package/dist/workerTypes.js +24 -0
  317. package/dist/workerTypes.js.map +1 -0
  318. package/dist/workers.d.ts +69 -0
  319. package/dist/workers.d.ts.map +1 -0
  320. package/dist/workers.js +68 -4
  321. package/dist/workers.js.map +1 -0
  322. package/npm-shrinkwrap.json +2 -2
  323. package/package.json +2 -1
  324. package/scripts/data_model.mjs +2058 -0
@@ -1,13 +1,49 @@
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
+ */
1
23
  import { ModeBase } from '@matter/types/clusters/mode-base';
2
24
  import { OvenMode } from '@matter/types/clusters/oven-mode';
3
25
  import { OperationalState } from '@matter/types/clusters/operational-state';
4
26
  import { OvenModeServer } from '@matter/node/behaviors/oven-mode';
5
27
  import { OvenCavityOperationalStateServer } from '@matter/node/behaviors/oven-cavity-operational-state';
28
+ // Matterbridge
6
29
  import { oven, powerSource, temperatureControlledCabinetHeater } from '../matterbridgeDeviceTypes.js';
7
30
  import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
8
31
  import { MatterbridgeServer } from '../matterbridgeBehaviors.js';
9
32
  import { createLevelTemperatureControlClusterServer } from './temperatureControl.js';
10
33
  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
+ */
11
47
  constructor(name, serial) {
12
48
  super([oven, powerSource], { id: `${name.replaceAll(' ', '')}-${serial.replaceAll(' ', '')}` });
13
49
  this.createDefaultIdentifyClusterServer();
@@ -15,6 +51,25 @@ export class Oven extends MatterbridgeEndpoint {
15
51
  this.createDefaultPowerSourceWiredClusterServer();
16
52
  this.addFixedLabel('composed', 'Oven');
17
53
  }
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
+ */
18
73
  addCabinet(name, tagList, currentMode = 2, supportedModes = [
19
74
  { label: 'Bake', mode: 1, modeTags: [{ value: OvenMode.ModeTag.Bake }] },
20
75
  { label: 'Convection', mode: 2, modeTags: [{ value: OvenMode.ModeTag.Convection }] },
@@ -36,6 +91,19 @@ export class Oven extends MatterbridgeEndpoint {
36
91
  this.createDefaultOvenCavityOperationalStateClusterServer(cabinet, operationalState, currentPhase, phaseList);
37
92
  return cabinet;
38
93
  }
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
+ */
39
107
  createDefaultOvenModeClusterServer(endpoint, currentMode, supportedModes) {
40
108
  endpoint.behaviors.require(MatterbridgeOvenModeServer, {
41
109
  supportedModes,
@@ -43,6 +111,20 @@ export class Oven extends MatterbridgeEndpoint {
43
111
  });
44
112
  return endpoint;
45
113
  }
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
+ */
46
128
  createDefaultOvenCavityOperationalStateClusterServer(endpoint, operationalState = OperationalState.OperationalStateEnum.Stopped, currentPhase, phaseList) {
47
129
  endpoint.behaviors.require(MatterbridgeOvenCavityOperationalStateServer, {
48
130
  phaseList: phaseList || null,
@@ -54,6 +136,7 @@ export class Oven extends MatterbridgeEndpoint {
54
136
  return endpoint;
55
137
  }
56
138
  }
139
+ // Server for OvenMode
57
140
  export class MatterbridgeOvenModeServer extends OvenModeServer {
58
141
  initialize() {
59
142
  const device = this.endpoint.stateOf(MatterbridgeServer);
@@ -73,6 +156,7 @@ export class MatterbridgeOvenModeServer extends OvenModeServer {
73
156
  }
74
157
  }
75
158
  }
159
+ // Server for OvenCavityOperationalState
76
160
  export class MatterbridgeOvenCavityOperationalStateServer extends OvenCavityOperationalStateServer {
77
161
  initialize() {
78
162
  const device = this.endpoint.stateOf(MatterbridgeServer);
@@ -99,3 +183,4 @@ export class MatterbridgeOvenCavityOperationalStateServer extends OvenCavityOper
99
183
  };
100
184
  }
101
185
  }
186
+ //# sourceMappingURL=oven.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oven.js","sourceRoot":"","sources":["../../src/devices/oven.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAC;AAExG,eAAe;AACf,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,kCAAkC,EAAE,MAAM,+BAA+B,CAAC;AACtG,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEjE,OAAO,EAAE,0CAA0C,EAAE,MAAM,yBAAyB,CAAC;AAErF,MAAM,OAAO,IAAK,SAAQ,oBAAoB;IAC5C;;;;;;;;;;;;OAYG;IACH,YAAY,IAAY,EAAE,MAAc;QACtC,KAAK,CAAC,CAAC,IAAI,EAA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AAoB,CAAC,OAAO,CAAC;QAC5E,IAAI,CAAC,KAAK,CAAC,gBAAgB,GAAG,EAAE,YAAY,EAAE,gBAAgB,CAAC,UAAU,CAAC,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,CAAC;QAC5H,OAAO;YACL,oBAAoB,EAAE,EAAE,YAAY,EAAE,gBAAgB,CAAC,UAAU,CAAC,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE;SACrE,CAAC;IACnD,CAAC;CACF"}
@@ -0,0 +1,118 @@
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
+ import { MaybePromise } from '@matter/general';
24
+ import { Semtag } from '@matter/types';
25
+ import { ModeBase } from '@matter/types/clusters/mode-base';
26
+ import { RefrigeratorAndTemperatureControlledCabinetMode } from '@matter/types/clusters/refrigerator-and-temperature-controlled-cabinet-mode';
27
+ import { RefrigeratorAndTemperatureControlledCabinetModeServer } from '@matter/node/behaviors/refrigerator-and-temperature-controlled-cabinet-mode';
28
+ import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
29
+ export declare class Refrigerator extends MatterbridgeEndpoint {
30
+ /**
31
+ * Creates an instance of the Refrigerator class.
32
+ *
33
+ * @param {string} name - The name of the refrigerator.
34
+ * @param {string} serial - The serial number of the refrigerator.
35
+ *
36
+ * @remarks
37
+ * 13.2 A refrigerator represents a device that contains one or more cabinets that are capable of chilling or
38
+ * freezing food. Examples of consumer products that MAY make use of this device type include refrigerators,
39
+ * freezers, and wine coolers.
40
+ * A refrigerator is always defined via endpoint composition.
41
+ * - Use `addCabinet` to add one or more cabinets to the refrigerator.
42
+ */
43
+ constructor(name: string, serial: string);
44
+ /**
45
+ * Adds a Level Temperature Controlled Cabinet Cooler to the refrigerator.
46
+ *
47
+ * @param {string} name - The name of the cabinet.
48
+ * @param {Semtag[]} tagList - The tagList associated with the cabinet.
49
+ * @param {number} currentMode - The current mode of the cabinet. Defaults to 1 (which corresponds to 'Auto').
50
+ * @param {RefrigeratorAndTemperatureControlledCabinetMode.ModeOption[]} supportedModes - The supported modes for the cabinet. Defaults to 'Auto', 'RapidCool', and 'RapidFreeze'.
51
+ * @param {number} selectedTemperatureLevel - The selected temperature level as an index of the supportedTemperatureLevels array. Defaults to 2 (which corresponds to 'Level 3').
52
+ * @param {string[]} supportedTemperatureLevels - The list of supported temperature levels for the cabinet. Defaults to ['Level 1', 'Level 2', 'Level 3', 'Level 4', 'Level 5'].
53
+ * @param {number} currentTemperature - The current temperature of the cabinet in degrees Celsius. Defaults to 1000 (which corresponds to 10.00 degrees Celsius).
54
+ *
55
+ * @returns {MatterbridgeEndpoint} The MatterbridgeEndpoint instance representing the cabinet.
56
+ *
57
+ * @remarks
58
+ * 13.4.1 A Temperature Controlled Cabinet Cooler is a device that provides a cooled space for chilling food.
59
+ * It is typically installed within a refrigerator.
60
+ *
61
+ * Example usage with specific namespace tags:
62
+ * ```
63
+ * refrigerator.addCabinet('Refrigerator Top', [
64
+ * { mfgCode: null, namespaceId: PositionTag.Top.namespaceId, tag: PositionTag.Top.tag, label: 'Refrigerator Top' },
65
+ * { mfgCode: null, namespaceId: RefrigeratorTag.Refrigerator.namespaceId, tag: RefrigeratorTag.Refrigerator.tag, label: RefrigeratorTag.Refrigerator.label },
66
+ * ]);
67
+ * refrigerator.addCabinet('Freezer Bottom', [
68
+ * { mfgCode: null, namespaceId: PositionTag.Bottom.namespaceId, tag: PositionTag.Bottom.tag, label: 'Freezer Bottom' },
69
+ * { mfgCode: null, namespaceId: RefrigeratorTag.Freezer.namespaceId, tag: RefrigeratorTag.Freezer.tag, label: RefrigeratorTag.Freezer.label },
70
+ * ]);
71
+ * ```
72
+ */
73
+ addCabinet(name: string, tagList: Semtag[], currentMode?: number, supportedModes?: RefrigeratorAndTemperatureControlledCabinetMode.ModeOption[], selectedTemperatureLevel?: number, supportedTemperatureLevels?: string[], currentTemperature?: number): MatterbridgeEndpoint;
74
+ /**
75
+ * Creates a default RefrigeratorAndTemperatureControlledCabinetMode Cluster Server.
76
+ *
77
+ * @param {MatterbridgeEndpoint} endpoint - The Matterbridge endpoint instance.
78
+ * @param {number} currentMode - The current mode of the oven.
79
+ * @param {RefrigeratorAndTemperatureControlledCabinetMode.ModeOption[]} supportedModes - The supported modes for the refrigerator and temperature controlled cabinet.
80
+ *
81
+ * @returns {MatterbridgeEndpoint} The current MatterbridgeEndpoint instance for chaining.
82
+ *
83
+ * @remarks
84
+ * - supportedModes is a fixed attribute. It cannot be changed at runtime.
85
+ * - currentMode persists across reboots.
86
+ */
87
+ createDefaultRefrigeratorAndTemperatureControlledCabinetModeClusterServer(endpoint: MatterbridgeEndpoint, currentMode: number, supportedModes: RefrigeratorAndTemperatureControlledCabinetMode.ModeOption[]): MatterbridgeEndpoint;
88
+ /**
89
+ * Creates a default RefrigeratorAlarm Cluster Server.
90
+ *
91
+ * @param {MatterbridgeEndpoint} endpoint - The Matterbridge endpoint instance.
92
+ * @param {boolean} doorOpen - Indicates if the refrigerator door is open.
93
+ *
94
+ * @returns {MatterbridgeEndpoint} The updated MatterbridgeEndpoint instance.
95
+ */
96
+ createDefaultRefrigeratorAlarmClusterServer(endpoint: MatterbridgeEndpoint, doorOpen?: boolean): MatterbridgeEndpoint;
97
+ /**
98
+ * Sets the door open state for a specific cabinet.
99
+ *
100
+ * @param {string} cabinetName - The name of the cabinet.
101
+ * @param {boolean} doorOpen - Indicates if the door is open.
102
+ * @returns {MatterbridgeEndpoint | undefined} The updated MatterbridgeEndpoint instance or undefined if not found.
103
+ */
104
+ setDoorOpenState(cabinetName: string, doorOpen: boolean): Promise<MatterbridgeEndpoint | undefined>;
105
+ /**
106
+ * Triggers the notify event for door open state on a specific cabinet.
107
+ *
108
+ * @param {string} cabinetName - The name of the cabinet.
109
+ * @param {boolean} doorOpen - Indicates if the door is open.
110
+ * @returns {MatterbridgeEndpoint | undefined} The updated MatterbridgeEndpoint instance or undefined if not found.
111
+ */
112
+ triggerDoorOpenState(cabinetName: string, doorOpen: boolean): Promise<MatterbridgeEndpoint | undefined>;
113
+ }
114
+ export declare class MatterbridgeRefrigeratorAndTemperatureControlledCabinetModeServer extends RefrigeratorAndTemperatureControlledCabinetModeServer {
115
+ initialize(): void;
116
+ changeToMode(request: ModeBase.ChangeToModeRequest): MaybePromise<ModeBase.ChangeToModeResponse>;
117
+ }
118
+ //# sourceMappingURL=refrigerator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refrigerator.d.ts","sourceRoot":"","sources":["../../src/devices/refrigerator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAE,+CAA+C,EAAE,MAAM,6EAA6E,CAAC;AAC9I,OAAO,EAAE,qDAAqD,EAAE,MAAM,6EAA6E,CAAC;AAKpJ,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAKlE,qBAAa,YAAa,SAAQ,oBAAoB;IACpD;;;;;;;;;;;;OAYG;gBACS,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAQxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,UAAU,CACR,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EAAE,EACjB,WAAW,GAAE,MAAU,EACvB,cAAc,GAAE,+CAA+C,CAAC,UAAU,EAIzE,EACD,wBAAwB,GAAE,MAAU,EACpC,0BAA0B,GAAE,MAAM,EAA4D,EAC9F,kBAAkB,GAAE,MAAa,GAChC,oBAAoB;IAWvB;;;;;;;;;;;;OAYG;IACH,yEAAyE,CAAC,QAAQ,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,+CAA+C,CAAC,UAAU,EAAE,GAAG,oBAAoB;IAQlO;;;;;;;OAOG;IACH,2CAA2C,CAAC,QAAQ,EAAE,oBAAoB,EAAE,QAAQ,GAAE,OAAe,GAAG,oBAAoB;IAS5H;;;;;;OAMG;IACG,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC;IAQzG;;;;;;OAMG;IACG,oBAAoB,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC;CAW9G;AAGD,qBAAa,iEAAkE,SAAQ,qDAAqD;IACjI,UAAU;IAIV,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,mBAAmB,GAAG,YAAY,CAAC,QAAQ,CAAC,oBAAoB,CAAC;CAY1G"}
@@ -1,12 +1,48 @@
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
+ */
1
23
  import { ModeBase } from '@matter/types/clusters/mode-base';
2
24
  import { RefrigeratorAndTemperatureControlledCabinetMode } from '@matter/types/clusters/refrigerator-and-temperature-controlled-cabinet-mode';
3
25
  import { RefrigeratorAndTemperatureControlledCabinetModeServer } from '@matter/node/behaviors/refrigerator-and-temperature-controlled-cabinet-mode';
4
26
  import { RefrigeratorAlarmServer } from '@matter/node/behaviors/refrigerator-alarm';
27
+ // Matterbridge
5
28
  import { powerSource, refrigerator, temperatureControlledCabinetCooler } from '../matterbridgeDeviceTypes.js';
6
29
  import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
7
30
  import { MatterbridgeServer } from '../matterbridgeBehaviors.js';
8
31
  import { createLevelTemperatureControlClusterServer } from './temperatureControl.js';
9
32
  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
+ */
10
46
  constructor(name, serial) {
11
47
  super([refrigerator, powerSource], { id: `${name.replaceAll(' ', '')}-${serial.replaceAll(' ', '')}` }, true);
12
48
  this.createDefaultIdentifyClusterServer();
@@ -14,6 +50,35 @@ export class Refrigerator extends MatterbridgeEndpoint {
14
50
  this.createDefaultPowerSourceWiredClusterServer();
15
51
  this.addFixedLabel('composed', 'Refrigerator');
16
52
  }
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
+ */
17
82
  addCabinet(name, tagList, currentMode = 1, supportedModes = [
18
83
  { label: 'Auto', mode: 1, modeTags: [{ value: RefrigeratorAndTemperatureControlledCabinetMode.ModeTag.Auto }] },
19
84
  { label: 'RapidCool', mode: 2, modeTags: [{ value: RefrigeratorAndTemperatureControlledCabinetMode.ModeTag.RapidCool }] },
@@ -28,6 +93,19 @@ export class Refrigerator extends MatterbridgeEndpoint {
28
93
  cabinet.createDefaultTemperatureMeasurementClusterServer(currentTemperature);
29
94
  return cabinet;
30
95
  }
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
+ */
31
109
  createDefaultRefrigeratorAndTemperatureControlledCabinetModeClusterServer(endpoint, currentMode, supportedModes) {
32
110
  endpoint.behaviors.require(MatterbridgeRefrigeratorAndTemperatureControlledCabinetModeServer, {
33
111
  supportedModes,
@@ -35,6 +113,14 @@ export class Refrigerator extends MatterbridgeEndpoint {
35
113
  });
36
114
  return endpoint;
37
115
  }
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
+ */
38
124
  createDefaultRefrigeratorAlarmClusterServer(endpoint, doorOpen = false) {
39
125
  endpoint.behaviors.require(RefrigeratorAlarmServer, {
40
126
  mask: { doorOpen: true },
@@ -43,6 +129,13 @@ export class Refrigerator extends MatterbridgeEndpoint {
43
129
  });
44
130
  return endpoint;
45
131
  }
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
+ */
46
139
  async setDoorOpenState(cabinetName, doorOpen) {
47
140
  const endpoint = this.getChildEndpointByName(cabinetName);
48
141
  if (endpoint) {
@@ -50,6 +143,13 @@ export class Refrigerator extends MatterbridgeEndpoint {
50
143
  return endpoint;
51
144
  }
52
145
  }
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
+ */
53
153
  async triggerDoorOpenState(cabinetName, doorOpen) {
54
154
  const endpoint = this.getChildEndpointByName(cabinetName);
55
155
  if (endpoint) {
@@ -63,6 +163,7 @@ export class Refrigerator extends MatterbridgeEndpoint {
63
163
  }
64
164
  }
65
165
  }
166
+ // Server for RefrigeratorAndTemperatureControlledCabinetMode
66
167
  export class MatterbridgeRefrigeratorAndTemperatureControlledCabinetModeServer extends RefrigeratorAndTemperatureControlledCabinetModeServer {
67
168
  initialize() {
68
169
  const device = this.endpoint.stateOf(MatterbridgeServer);
@@ -82,3 +183,4 @@ export class MatterbridgeRefrigeratorAndTemperatureControlledCabinetModeServer e
82
183
  }
83
184
  }
84
185
  }
186
+ //# sourceMappingURL=refrigerator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refrigerator.js","sourceRoot":"","sources":["../../src/devices/refrigerator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,OA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6FAA6F,IAAI,CAAC,QAAQ,CAAC,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,8BAA8B,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;YACjN,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,gBAAgB,CAAC,aAAa,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC;QACzF,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,112 @@
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
+ import { MaybePromise } from '@matter/general';
24
+ import { RvcRunMode } from '@matter/types/clusters/rvc-run-mode';
25
+ import { RvcCleanMode } from '@matter/types/clusters/rvc-clean-mode';
26
+ import { RvcOperationalState } from '@matter/types/clusters/rvc-operational-state';
27
+ import { ServiceArea } from '@matter/types/clusters/service-area';
28
+ import { ModeBase } from '@matter/types/clusters/mode-base';
29
+ import { OperationalState } from '@matter/types/clusters/operational-state';
30
+ import { RvcRunModeServer } from '@matter/node/behaviors/rvc-run-mode';
31
+ import { RvcOperationalStateServer } from '@matter/node/behaviors/rvc-operational-state';
32
+ import { RvcCleanModeServer } from '@matter/node/behaviors/rvc-clean-mode';
33
+ import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
34
+ export declare class RoboticVacuumCleaner extends MatterbridgeEndpoint {
35
+ /**
36
+ * Creates an instance of the RoboticVacuumCleaner class.
37
+ *
38
+ * @param {string} name - The name of the robotic vacuum cleaner.
39
+ * @param {string} serial - The serial number of the robotic vacuum cleaner.
40
+ * @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.
41
+ * @param {number} [currentRunMode] - The current run mode of the robotic vacuum cleaner. Defaults to 1 (Idle).
42
+ * @param {RvcRunMode.ModeOption[]} [supportedRunModes] - The supported run modes for the robotic vacuum cleaner. Defaults to a predefined set of modes.
43
+ * @param {number} [currentCleanMode] - The current clean mode of the robotic vacuum cleaner. Defaults to 1 (Vacuum).
44
+ * @param {RvcCleanMode.ModeOption[]} [supportedCleanModes] - The supported clean modes for the robotic vacuum cleaner. Defaults to a predefined set of modes.
45
+ * @param {number | null} [currentPhase] - The current phase of the robotic vacuum cleaner. Defaults to null.
46
+ * @param {string[] | null} [phaseList] - The list of phases for the robotic vacuum cleaner. Defaults to null.
47
+ * @param {RvcOperationalState.OperationalState} [operationalState] - The current operational state of the robotic vacuum cleaner. Defaults to Docked.
48
+ * @param {RvcOperationalState.OperationalStateStruct[]} [operationalStateList] - The list of operational states for the robotic vacuum cleaner. Defaults to a predefined set of states.
49
+ * @param {ServiceArea.Area[]} [supportedAreas] - The supported areas for the robotic vacuum cleaner. Defaults to a predefined set of areas.
50
+ * @param {number[]} [selectedAreas] - The selected areas for the robotic vacuum cleaner. Defaults to an empty array (all areas allowed).
51
+ * @param {number} [currentArea] - The current area of the robotic vacuum cleaner. Defaults to 1 (Living).
52
+ * @param {ServiceArea.Map[]} [supportedMaps] - The supported maps for the robotic vacuum cleaner. Defaults to empty list.
53
+ */
54
+ constructor(name: string, serial: string, mode?: 'server' | 'matter' | undefined, currentRunMode?: number, supportedRunModes?: RvcRunMode.ModeOption[], currentCleanMode?: number, supportedCleanModes?: RvcCleanMode.ModeOption[], currentPhase?: number | null, phaseList?: string[] | null, operationalState?: RvcOperationalState.OperationalState, operationalStateList?: RvcOperationalState.OperationalStateStruct[], supportedAreas?: ServiceArea.Area[], selectedAreas?: number[], currentArea?: number, supportedMaps?: ServiceArea.Map[]);
55
+ /**
56
+ * Creates a default RvcRunMode Cluster Server.
57
+ *
58
+ * @param {number} [currentMode] - The current mode of the RvcRunMode cluster. Defaults to 1 (Idle).
59
+ * @param {RvcRunMode.ModeOption[]} [supportedModes] - The supported modes for the RvcRunMode cluster. Defaults to a predefined set of modes.
60
+ *
61
+ * @returns {this} The current MatterbridgeEndpoint instance for chaining.
62
+ *
63
+ * @remarks
64
+ * - supportedModes is a fixed attribute that defines the run modes available for the robotic vacuum cleaner.
65
+ */
66
+ createDefaultRvcRunModeClusterServer(currentMode?: number, supportedModes?: RvcRunMode.ModeOption[]): this;
67
+ /**
68
+ * Creates a default RvcCleanMode Cluster Server.
69
+ *
70
+ * @param {number} [currentMode] - The current mode of the RvcCleanMode cluster. Defaults to 1 (Vacuum).
71
+ * @param {RvcCleanMode.ModeOption[]} [supportedModes] - The supported modes for the RvcCleanMode cluster. Defaults to a predefined set of modes.
72
+ *
73
+ * @returns {this} The current MatterbridgeEndpoint instance for chaining.
74
+ *
75
+ * @remarks
76
+ * - supportedModes is a fixed attribute that defines the clean modes available for the robotic vacuum cleaner.
77
+ */
78
+ createDefaultRvcCleanModeClusterServer(currentMode?: number, supportedModes?: RvcCleanMode.ModeOption[]): this;
79
+ /**
80
+ * Creates a default ServiceArea Cluster Server.
81
+ *
82
+ * @param {ServiceArea.Area[]} [supportedAreas] - The supported areas for the ServiceArea cluster. Defaults to a predefined set of areas.
83
+ * @param {number[]} [selectedAreas] - The selected areas for the ServiceArea cluster. Defaults to an empty array (all areas allowed).
84
+ * @param {number} [currentArea] - The current areaId (not the index in the array!) of the ServiceArea cluster. Defaults to 1 (Living).
85
+ * @param {ServiceArea.Map[]} [supportedMaps] - The supported maps for the robotic vacuum cleaner. Defaults empty list.
86
+ * @returns {this} The current MatterbridgeEndpoint instance for chaining.
87
+ */
88
+ createDefaultServiceAreaClusterServer(supportedAreas?: ServiceArea.Area[], selectedAreas?: number[], currentArea?: number, supportedMaps?: ServiceArea.Map[]): this;
89
+ /**
90
+ * Creates a default RvcOperationalState Cluster Server.
91
+ *
92
+ * @param {string[] | null} [phaseList] - The list of phases for the RvcOperationalState cluster. Defaults to null.
93
+ * @param {number | null} [currentPhase] - The current phase (the index of the phaseList) of the RvcOperationalState cluster. Defaults to null.
94
+ * @param {RvcOperationalState.OperationalStateStruct[]} [operationalStateList] - The list of operational states for the RvcOperationalState cluster. Defaults to a predefined set of states.
95
+ * @param {RvcOperationalState.OperationalState} [operationalState] - The current operationalStateId of the RvcOperationalState cluster. Defaults to Docked.
96
+ * @param {RvcOperationalState.ErrorStateStruct} [operationalError] - The current operational error of the RvcOperationalState cluster. Defaults to NoError.
97
+ * @returns {this} The current MatterbridgeEndpoint instance for chaining.
98
+ */
99
+ createDefaultRvcOperationalStateClusterServer(phaseList?: string[] | null, currentPhase?: number | null, operationalStateList?: RvcOperationalState.OperationalStateStruct[], operationalState?: RvcOperationalState.OperationalState, operationalError?: RvcOperationalState.ErrorStateStruct): this;
100
+ }
101
+ export declare class MatterbridgeRvcRunModeServer extends RvcRunModeServer {
102
+ changeToMode(request: ModeBase.ChangeToModeRequest): MaybePromise<ModeBase.ChangeToModeResponse>;
103
+ }
104
+ export declare class MatterbridgeRvcCleanModeServer extends RvcCleanModeServer {
105
+ changeToMode(request: ModeBase.ChangeToModeRequest): MaybePromise<ModeBase.ChangeToModeResponse>;
106
+ }
107
+ export declare class MatterbridgeRvcOperationalStateServer extends RvcOperationalStateServer {
108
+ pause(): MaybePromise<OperationalState.OperationalCommandResponse>;
109
+ resume(): MaybePromise<OperationalState.OperationalCommandResponse>;
110
+ goHome(): MaybePromise<OperationalState.OperationalCommandResponse>;
111
+ }
112
+ //# sourceMappingURL=roboticVacuumCleaner.d.ts.map
@@ -0,0 +1 @@
1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