matterbridge 3.3.8-dev-20251115-ca5ff21 → 3.3.8

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 (310) hide show
  1. package/dist/broadcastServer.d.ts +115 -0
  2. package/dist/broadcastServer.d.ts.map +1 -0
  3. package/dist/broadcastServer.js +93 -1
  4. package/dist/broadcastServer.js.map +1 -0
  5. package/dist/broadcastServerTypes.d.ts +806 -0
  6. package/dist/broadcastServerTypes.d.ts.map +1 -0
  7. package/dist/broadcastServerTypes.js +24 -0
  8. package/dist/broadcastServerTypes.js.map +1 -0
  9. package/dist/cli.d.ts +30 -0
  10. package/dist/cli.d.ts.map +1 -0
  11. package/dist/cli.js +97 -1
  12. package/dist/cli.js.map +1 -0
  13. package/dist/cliEmitter.d.ts +50 -0
  14. package/dist/cliEmitter.d.ts.map +1 -0
  15. package/dist/cliEmitter.js +37 -0
  16. package/dist/cliEmitter.js.map +1 -0
  17. package/dist/cliHistory.d.ts +48 -0
  18. package/dist/cliHistory.d.ts.map +1 -0
  19. package/dist/cliHistory.js +38 -0
  20. package/dist/cliHistory.js.map +1 -0
  21. package/dist/clusters/export.d.ts +2 -0
  22. package/dist/clusters/export.d.ts.map +1 -0
  23. package/dist/clusters/export.js +2 -0
  24. package/dist/clusters/export.js.map +1 -0
  25. package/dist/defaultConfigSchema.d.ts +28 -0
  26. package/dist/defaultConfigSchema.d.ts.map +1 -0
  27. package/dist/defaultConfigSchema.js +24 -0
  28. package/dist/defaultConfigSchema.js.map +1 -0
  29. package/dist/deviceManager.d.ts +128 -0
  30. package/dist/deviceManager.d.ts.map +1 -0
  31. package/dist/deviceManager.js +105 -1
  32. package/dist/deviceManager.js.map +1 -0
  33. package/dist/devices/airConditioner.d.ts +98 -0
  34. package/dist/devices/airConditioner.d.ts.map +1 -0
  35. package/dist/devices/airConditioner.js +57 -0
  36. package/dist/devices/airConditioner.js.map +1 -0
  37. package/dist/devices/batteryStorage.d.ts +48 -0
  38. package/dist/devices/batteryStorage.d.ts.map +1 -0
  39. package/dist/devices/batteryStorage.js +48 -1
  40. package/dist/devices/batteryStorage.js.map +1 -0
  41. package/dist/devices/cooktop.d.ts +60 -0
  42. package/dist/devices/cooktop.d.ts.map +1 -0
  43. package/dist/devices/cooktop.js +55 -0
  44. package/dist/devices/cooktop.js.map +1 -0
  45. package/dist/devices/dishwasher.d.ts +71 -0
  46. package/dist/devices/dishwasher.d.ts.map +1 -0
  47. package/dist/devices/dishwasher.js +57 -0
  48. package/dist/devices/dishwasher.js.map +1 -0
  49. package/dist/devices/evse.d.ts +76 -0
  50. package/dist/devices/evse.d.ts.map +1 -0
  51. package/dist/devices/evse.js +74 -10
  52. package/dist/devices/evse.js.map +1 -0
  53. package/dist/devices/export.d.ts +17 -0
  54. package/dist/devices/export.d.ts.map +1 -0
  55. package/dist/devices/export.js +5 -0
  56. package/dist/devices/export.js.map +1 -0
  57. package/dist/devices/extractorHood.d.ts +46 -0
  58. package/dist/devices/extractorHood.d.ts.map +1 -0
  59. package/dist/devices/extractorHood.js +43 -0
  60. package/dist/devices/extractorHood.js.map +1 -0
  61. package/dist/devices/heatPump.d.ts +47 -0
  62. package/dist/devices/heatPump.d.ts.map +1 -0
  63. package/dist/devices/heatPump.js +50 -2
  64. package/dist/devices/heatPump.js.map +1 -0
  65. package/dist/devices/laundryDryer.d.ts +67 -0
  66. package/dist/devices/laundryDryer.d.ts.map +1 -0
  67. package/dist/devices/laundryDryer.js +62 -3
  68. package/dist/devices/laundryDryer.js.map +1 -0
  69. package/dist/devices/laundryWasher.d.ts +81 -0
  70. package/dist/devices/laundryWasher.d.ts.map +1 -0
  71. package/dist/devices/laundryWasher.js +70 -4
  72. package/dist/devices/laundryWasher.js.map +1 -0
  73. package/dist/devices/microwaveOven.d.ts +168 -0
  74. package/dist/devices/microwaveOven.d.ts.map +1 -0
  75. package/dist/devices/microwaveOven.js +88 -5
  76. package/dist/devices/microwaveOven.js.map +1 -0
  77. package/dist/devices/oven.d.ts +105 -0
  78. package/dist/devices/oven.d.ts.map +1 -0
  79. package/dist/devices/oven.js +92 -11
  80. package/dist/devices/oven.js.map +1 -0
  81. package/dist/devices/refrigerator.d.ts +118 -0
  82. package/dist/devices/refrigerator.d.ts.map +1 -0
  83. package/dist/devices/refrigerator.js +102 -0
  84. package/dist/devices/refrigerator.js.map +1 -0
  85. package/dist/devices/roboticVacuumCleaner.d.ts +112 -0
  86. package/dist/devices/roboticVacuumCleaner.d.ts.map +1 -0
  87. package/dist/devices/roboticVacuumCleaner.js +111 -20
  88. package/dist/devices/roboticVacuumCleaner.js.map +1 -0
  89. package/dist/devices/solarPower.d.ts +40 -0
  90. package/dist/devices/solarPower.d.ts.map +1 -0
  91. package/dist/devices/solarPower.js +38 -0
  92. package/dist/devices/solarPower.js.map +1 -0
  93. package/dist/devices/speaker.d.ts +87 -0
  94. package/dist/devices/speaker.d.ts.map +1 -0
  95. package/dist/devices/speaker.js +84 -0
  96. package/dist/devices/speaker.js.map +1 -0
  97. package/dist/devices/temperatureControl.d.ts +166 -0
  98. package/dist/devices/temperatureControl.d.ts.map +1 -0
  99. package/dist/devices/temperatureControl.js +24 -3
  100. package/dist/devices/temperatureControl.js.map +1 -0
  101. package/dist/devices/waterHeater.d.ts +111 -0
  102. package/dist/devices/waterHeater.d.ts.map +1 -0
  103. package/dist/devices/waterHeater.js +82 -2
  104. package/dist/devices/waterHeater.js.map +1 -0
  105. package/dist/dgram/coap.d.ts +205 -0
  106. package/dist/dgram/coap.d.ts.map +1 -0
  107. package/dist/dgram/coap.js +126 -13
  108. package/dist/dgram/coap.js.map +1 -0
  109. package/dist/dgram/dgram.d.ts +141 -0
  110. package/dist/dgram/dgram.d.ts.map +1 -0
  111. package/dist/dgram/dgram.js +114 -2
  112. package/dist/dgram/dgram.js.map +1 -0
  113. package/dist/dgram/mb_coap.d.ts +24 -0
  114. package/dist/dgram/mb_coap.d.ts.map +1 -0
  115. package/dist/dgram/mb_coap.js +41 -3
  116. package/dist/dgram/mb_coap.js.map +1 -0
  117. package/dist/dgram/mb_mdns.d.ts +24 -0
  118. package/dist/dgram/mb_mdns.d.ts.map +1 -0
  119. package/dist/dgram/mb_mdns.js +80 -15
  120. package/dist/dgram/mb_mdns.js.map +1 -0
  121. package/dist/dgram/mdns.d.ts +290 -0
  122. package/dist/dgram/mdns.d.ts.map +1 -0
  123. package/dist/dgram/mdns.js +299 -137
  124. package/dist/dgram/mdns.js.map +1 -0
  125. package/dist/dgram/multicast.d.ts +67 -0
  126. package/dist/dgram/multicast.d.ts.map +1 -0
  127. package/dist/dgram/multicast.js +62 -1
  128. package/dist/dgram/multicast.js.map +1 -0
  129. package/dist/dgram/unicast.d.ts +56 -0
  130. package/dist/dgram/unicast.d.ts.map +1 -0
  131. package/dist/dgram/unicast.js +54 -0
  132. package/dist/dgram/unicast.js.map +1 -0
  133. package/dist/frontend.d.ts +238 -0
  134. package/dist/frontend.d.ts.map +1 -0
  135. package/dist/frontend.js +454 -35
  136. package/dist/frontend.js.map +1 -0
  137. package/dist/frontendTypes.d.ts +529 -0
  138. package/dist/frontendTypes.d.ts.map +1 -0
  139. package/dist/frontendTypes.js +45 -0
  140. package/dist/frontendTypes.js.map +1 -0
  141. package/dist/helpers.d.ts +48 -0
  142. package/dist/helpers.d.ts.map +1 -0
  143. package/dist/helpers.js +53 -0
  144. package/dist/helpers.js.map +1 -0
  145. package/dist/index.d.ts +34 -0
  146. package/dist/index.d.ts.map +1 -0
  147. package/dist/index.js +25 -0
  148. package/dist/index.js.map +1 -0
  149. package/dist/jestutils/export.d.ts +2 -0
  150. package/dist/jestutils/export.d.ts.map +1 -0
  151. package/dist/jestutils/export.js +1 -0
  152. package/dist/jestutils/export.js.map +1 -0
  153. package/dist/jestutils/jestHelpers.d.ts +250 -0
  154. package/dist/jestutils/jestHelpers.d.ts.map +1 -0
  155. package/dist/jestutils/jestHelpers.js +275 -4
  156. package/dist/jestutils/jestHelpers.js.map +1 -0
  157. package/dist/logger/export.d.ts +2 -0
  158. package/dist/logger/export.d.ts.map +1 -0
  159. package/dist/logger/export.js +1 -0
  160. package/dist/logger/export.js.map +1 -0
  161. package/dist/matter/behaviors.d.ts +2 -0
  162. package/dist/matter/behaviors.d.ts.map +1 -0
  163. package/dist/matter/behaviors.js +2 -0
  164. package/dist/matter/behaviors.js.map +1 -0
  165. package/dist/matter/clusters.d.ts +2 -0
  166. package/dist/matter/clusters.d.ts.map +1 -0
  167. package/dist/matter/clusters.js +2 -0
  168. package/dist/matter/clusters.js.map +1 -0
  169. package/dist/matter/devices.d.ts +2 -0
  170. package/dist/matter/devices.d.ts.map +1 -0
  171. package/dist/matter/devices.js +2 -0
  172. package/dist/matter/devices.js.map +1 -0
  173. package/dist/matter/endpoints.d.ts +2 -0
  174. package/dist/matter/endpoints.d.ts.map +1 -0
  175. package/dist/matter/endpoints.js +2 -0
  176. package/dist/matter/endpoints.js.map +1 -0
  177. package/dist/matter/export.d.ts +5 -0
  178. package/dist/matter/export.d.ts.map +1 -0
  179. package/dist/matter/export.js +3 -0
  180. package/dist/matter/export.js.map +1 -0
  181. package/dist/matter/types.d.ts +3 -0
  182. package/dist/matter/types.d.ts.map +1 -0
  183. package/dist/matter/types.js +3 -0
  184. package/dist/matter/types.js.map +1 -0
  185. package/dist/matterbridge.d.ts +469 -0
  186. package/dist/matterbridge.d.ts.map +1 -0
  187. package/dist/matterbridge.js +788 -46
  188. package/dist/matterbridge.js.map +1 -0
  189. package/dist/matterbridgeAccessoryPlatform.d.ts +41 -0
  190. package/dist/matterbridgeAccessoryPlatform.d.ts.map +1 -0
  191. package/dist/matterbridgeAccessoryPlatform.js +38 -0
  192. package/dist/matterbridgeAccessoryPlatform.js.map +1 -0
  193. package/dist/matterbridgeBehaviors.d.ts +2404 -0
  194. package/dist/matterbridgeBehaviors.d.ts.map +1 -0
  195. package/dist/matterbridgeBehaviors.js +77 -14
  196. package/dist/matterbridgeBehaviors.js.map +1 -0
  197. package/dist/matterbridgeDeviceTypes.d.ts +698 -0
  198. package/dist/matterbridgeDeviceTypes.d.ts.map +1 -0
  199. package/dist/matterbridgeDeviceTypes.js +635 -14
  200. package/dist/matterbridgeDeviceTypes.js.map +1 -0
  201. package/dist/matterbridgeDynamicPlatform.d.ts +41 -0
  202. package/dist/matterbridgeDynamicPlatform.d.ts.map +1 -0
  203. package/dist/matterbridgeDynamicPlatform.js +38 -0
  204. package/dist/matterbridgeDynamicPlatform.js.map +1 -0
  205. package/dist/matterbridgeEndpoint.d.ts +1490 -0
  206. package/dist/matterbridgeEndpoint.d.ts.map +1 -0
  207. package/dist/matterbridgeEndpoint.js +1432 -53
  208. package/dist/matterbridgeEndpoint.js.map +1 -0
  209. package/dist/matterbridgeEndpointHelpers.d.ts +787 -0
  210. package/dist/matterbridgeEndpointHelpers.d.ts.map +1 -0
  211. package/dist/matterbridgeEndpointHelpers.js +488 -25
  212. package/dist/matterbridgeEndpointHelpers.js.map +1 -0
  213. package/dist/matterbridgeEndpointTypes.d.ts +197 -0
  214. package/dist/matterbridgeEndpointTypes.d.ts.map +1 -0
  215. package/dist/matterbridgeEndpointTypes.js +25 -0
  216. package/dist/matterbridgeEndpointTypes.js.map +1 -0
  217. package/dist/matterbridgePlatform.d.ts +415 -0
  218. package/dist/matterbridgePlatform.d.ts.map +1 -0
  219. package/dist/matterbridgePlatform.js +354 -1
  220. package/dist/matterbridgePlatform.js.map +1 -0
  221. package/dist/matterbridgeTypes.d.ts +239 -0
  222. package/dist/matterbridgeTypes.d.ts.map +1 -0
  223. package/dist/matterbridgeTypes.js +26 -0
  224. package/dist/matterbridgeTypes.js.map +1 -0
  225. package/dist/pluginManager.d.ts +371 -0
  226. package/dist/pluginManager.d.ts.map +1 -0
  227. package/dist/pluginManager.js +339 -4
  228. package/dist/pluginManager.js.map +1 -0
  229. package/dist/shelly.d.ts +174 -0
  230. package/dist/shelly.d.ts.map +1 -0
  231. package/dist/shelly.js +168 -7
  232. package/dist/shelly.js.map +1 -0
  233. package/dist/storage/export.d.ts +2 -0
  234. package/dist/storage/export.d.ts.map +1 -0
  235. package/dist/storage/export.js +1 -0
  236. package/dist/storage/export.js.map +1 -0
  237. package/dist/update.d.ts +75 -0
  238. package/dist/update.d.ts.map +1 -0
  239. package/dist/update.js +69 -0
  240. package/dist/update.js.map +1 -0
  241. package/dist/utils/colorUtils.d.ts +101 -0
  242. package/dist/utils/colorUtils.d.ts.map +1 -0
  243. package/dist/utils/colorUtils.js +97 -2
  244. package/dist/utils/colorUtils.js.map +1 -0
  245. package/dist/utils/commandLine.d.ts +66 -0
  246. package/dist/utils/commandLine.d.ts.map +1 -0
  247. package/dist/utils/commandLine.js +60 -0
  248. package/dist/utils/commandLine.js.map +1 -0
  249. package/dist/utils/copyDirectory.d.ts +33 -0
  250. package/dist/utils/copyDirectory.d.ts.map +1 -0
  251. package/dist/utils/copyDirectory.js +38 -1
  252. package/dist/utils/copyDirectory.js.map +1 -0
  253. package/dist/utils/createDirectory.d.ts +34 -0
  254. package/dist/utils/createDirectory.d.ts.map +1 -0
  255. package/dist/utils/createDirectory.js +33 -0
  256. package/dist/utils/createDirectory.js.map +1 -0
  257. package/dist/utils/createZip.d.ts +39 -0
  258. package/dist/utils/createZip.d.ts.map +1 -0
  259. package/dist/utils/createZip.js +47 -2
  260. package/dist/utils/createZip.js.map +1 -0
  261. package/dist/utils/deepCopy.d.ts +32 -0
  262. package/dist/utils/deepCopy.d.ts.map +1 -0
  263. package/dist/utils/deepCopy.js +39 -0
  264. package/dist/utils/deepCopy.js.map +1 -0
  265. package/dist/utils/deepEqual.d.ts +54 -0
  266. package/dist/utils/deepEqual.d.ts.map +1 -0
  267. package/dist/utils/deepEqual.js +72 -1
  268. package/dist/utils/deepEqual.js.map +1 -0
  269. package/dist/utils/error.d.ts +44 -0
  270. package/dist/utils/error.d.ts.map +1 -0
  271. package/dist/utils/error.js +41 -0
  272. package/dist/utils/error.js.map +1 -0
  273. package/dist/utils/export.d.ts +13 -0
  274. package/dist/utils/export.d.ts.map +1 -0
  275. package/dist/utils/export.js +1 -0
  276. package/dist/utils/export.js.map +1 -0
  277. package/dist/utils/format.d.ts +53 -0
  278. package/dist/utils/format.d.ts.map +1 -0
  279. package/dist/utils/format.js +49 -0
  280. package/dist/utils/format.js.map +1 -0
  281. package/dist/utils/hex.d.ts +89 -0
  282. package/dist/utils/hex.d.ts.map +1 -0
  283. package/dist/utils/hex.js +124 -0
  284. package/dist/utils/hex.js.map +1 -0
  285. package/dist/utils/inspector.d.ts +87 -0
  286. package/dist/utils/inspector.d.ts.map +1 -0
  287. package/dist/utils/inspector.js +69 -1
  288. package/dist/utils/inspector.js.map +1 -0
  289. package/dist/utils/isvalid.d.ts +103 -0
  290. package/dist/utils/isvalid.d.ts.map +1 -0
  291. package/dist/utils/isvalid.js +101 -0
  292. package/dist/utils/isvalid.js.map +1 -0
  293. package/dist/utils/network.d.ts +101 -0
  294. package/dist/utils/network.d.ts.map +1 -0
  295. package/dist/utils/network.js +96 -5
  296. package/dist/utils/network.js.map +1 -0
  297. package/dist/utils/spawn.d.ts +35 -0
  298. package/dist/utils/spawn.d.ts.map +1 -0
  299. package/dist/utils/spawn.js +71 -0
  300. package/dist/utils/spawn.js.map +1 -0
  301. package/dist/utils/tracker.d.ts +108 -0
  302. package/dist/utils/tracker.d.ts.map +1 -0
  303. package/dist/utils/tracker.js +64 -1
  304. package/dist/utils/tracker.js.map +1 -0
  305. package/dist/utils/wait.d.ts +54 -0
  306. package/dist/utils/wait.d.ts.map +1 -0
  307. package/dist/utils/wait.js +60 -8
  308. package/dist/utils/wait.js.map +1 -0
  309. package/npm-shrinkwrap.json +2 -2
  310. package/package.json +2 -1
@@ -1,13 +1,59 @@
1
+ /**
2
+ * @description This file contains the LaundryWasher class.
3
+ * @file src/devices/laundryWasher.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 { LaundryWasherControls } from '@matter/types/clusters/laundry-washer-controls';
2
24
  import { LaundryWasherMode } from '@matter/types/clusters/laundry-washer-mode';
3
25
  import { ModeBase } from '@matter/types/clusters/mode-base';
4
26
  import { LaundryWasherModeServer } from '@matter/node/behaviors/laundry-washer-mode';
5
27
  import { LaundryWasherControlsServer } from '@matter/node/behaviors/laundry-washer-controls';
28
+ // Matterbridge
6
29
  import { laundryWasher, powerSource } from '../matterbridgeDeviceTypes.js';
7
30
  import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
8
31
  import { MatterbridgeOnOffServer, MatterbridgeServer } from '../matterbridgeBehaviors.js';
9
32
  import { createLevelTemperatureControlClusterServer, createNumberTemperatureControlClusterServer } from './temperatureControl.js';
10
33
  export class LaundryWasher extends MatterbridgeEndpoint {
34
+ /**
35
+ * Creates an instance of the LaundryWasher class.
36
+ *
37
+ * @param {string} name - The name of the laundry washer.
38
+ * @param {string} serial - The serial number of the laundry washer.
39
+ * @param {number} [currentMode] - The current mode of the laundry washer. Defaults to 2 (Normal mode). Dead Front OnOff Cluster will set this to 2 when turned off. Persistent attribute.
40
+ * @param {LaundryWasherMode.ModeOption[]} [supportedModes] - The supported modes of the laundry washer. Defaults to a set of common modes (which include Delicate, Normal, Heavy, and Whites). Fixed attribute.
41
+ * @param {number} [spinSpeedCurrent] - The current spin speed as index of the spinSpeeds array. Defaults to 2 (which corresponds to '1200').
42
+ * @param {string[]} [spinSpeeds] - The supported spin speeds. Defaults to ['400', '800', '1200', '1600'].
43
+ * @param {LaundryWasherControls.NumberOfRinses} [numberOfRinses] - The number of rinses. Defaults to LaundryWasherControls.NumberOfRinses.Normal (which corresponds to 1 rinse).
44
+ * @param {LaundryWasherControls.NumberOfRinses[]} [supportedRinses] - The supported rinses. Defaults to [NumberOfRinses.None, NumberOfRinses.Normal, NumberOfRinses.Max, NumberOfRinses.Extra].
45
+ * @param {number} [selectedTemperatureLevel] - The selected temperature level as an index of the supportedTemperatureLevels array. Defaults to 1 (which corresponds to 'Warm').
46
+ * @param {string[]} [supportedTemperatureLevels] - The supported temperature levels. Defaults to ['Cold', 'Warm', 'Hot', '30°', '40°', '60°', '80°']. Fixed attribute.
47
+ * @param {number} [temperatureSetpoint] - The temperature setpoint * 100. Defaults to 40 * 100 (which corresponds to 40°C).
48
+ * @param {number} [minTemperature] - The minimum temperature * 100. Defaults to 30 * 100 (which corresponds to 30°C). Fixed attribute.
49
+ * @param {number} [maxTemperature] - The maximum temperature * 100. Defaults to 60 * 100 (which corresponds to 60°C). Fixed attribute.
50
+ * @param {number} [step] - The step size for temperature changes. Defaults to 10 * 100 (which corresponds to 10°C). Fixed attribute.
51
+ * @param {OperationalState.OperationalStateEnum} [operationalState] - The operational state of the laundry washer. Defaults to OperationalState.OperationalStateEnum.Off.
52
+ *
53
+ * Remarks:
54
+ * - If `temperatureSetpoint` is provided, the `createNumberTemperatureControlClusterServer` method will be used to create the TemperatureControl Cluster Server with features TemperatureNumber and TemperatureStep.
55
+ * - If `temperatureSetpoint` is not provided, the `createLevelTemperatureControlClusterServer` method will be used to create the TemperatureControl Cluster Server with feature TemperatureLevel.
56
+ */
11
57
  constructor(name, serial, currentMode, supportedModes, spinSpeedCurrent, spinSpeeds, numberOfRinses, supportedRinses, selectedTemperatureLevel, supportedTemperatureLevels, temperatureSetpoint, minTemperature, maxTemperature, step, operationalState) {
12
58
  super([laundryWasher, powerSource], { id: `${name.replaceAll(' ', '')}-${serial.replaceAll(' ', '')}` });
13
59
  this.createDefaultIdentifyClusterServer();
@@ -22,6 +68,14 @@ export class LaundryWasher extends MatterbridgeEndpoint {
22
68
  createLevelTemperatureControlClusterServer(this, selectedTemperatureLevel, supportedTemperatureLevels);
23
69
  this.createDefaultOperationalStateClusterServer(operationalState);
24
70
  }
71
+ /**
72
+ * Creates a default Laundry Washer Mode Cluster Server.
73
+ *
74
+ * @param {number} currentMode - The current mode of the laundry washer. Defaults to 2 (Normal mode). Dead Front OnOff Cluster will set this to 2 when turned off. Persistent attribute.
75
+ * @param {LaundryWasherMode.ModeOption[]} supportedModes - The supported modes of the laundry washer. Defaults to a set of common modes (which include Delicate, Normal, Heavy, and Whites). Fixed attribute.
76
+ *
77
+ * @returns {this} The current MatterbridgeEndpoint instance for chaining.
78
+ */
25
79
  createDefaultLaundryWasherModeClusterServer(currentMode = 2, supportedModes = [
26
80
  { label: 'Delicate', mode: 1, modeTags: [{ value: LaundryWasherMode.ModeTag.Delicate }] },
27
81
  { label: 'Normal', mode: 2, modeTags: [{ value: LaundryWasherMode.ModeTag.Normal }] },
@@ -29,17 +83,27 @@ export class LaundryWasher extends MatterbridgeEndpoint {
29
83
  { label: 'Whites', mode: 4, modeTags: [{ value: LaundryWasherMode.ModeTag.Whites }] },
30
84
  ]) {
31
85
  this.behaviors.require(MatterbridgeLaundryWasherModeServer, {
32
- supportedModes,
33
- currentMode,
86
+ supportedModes, // Fixed attribute.
87
+ currentMode, // Persistent attribute.
34
88
  });
35
89
  return this;
36
90
  }
91
+ /**
92
+ * Creates a Laundry Washer Controls Cluster Server with feature Spin for selecting the spin speed and feature Rinse for selecting the number of rinses.
93
+ *
94
+ * @param {number} spinSpeedCurrent - The current spin speed as index of the spinSpeeds array. Default to 2 (which corresponds to '1200').
95
+ * @param {string[]} spinSpeeds - The supported spin speeds. Default to ['400', '800', '1200', '1600'].
96
+ * @param {LaundryWasherControls.NumberOfRinses} numberOfRinses - The number of rinses. Default to LaundryWasherControls.NumberOfRinses.Normal (which corresponds to 1 rinse).
97
+ * @param {LaundryWasherControls.NumberOfRinses[]} supportedRinses - The supported rinses. Default to [NumberOfRinses.None, NumberOfRinses.Normal, NumberOfRinses.Max, NumberOfRinses.Extra].
98
+ *
99
+ * @returns {this} The current MatterbridgeEndpoint instance for chaining.
100
+ */
37
101
  createDefaultLaundryWasherControlsClusterServer(spinSpeedCurrent = 2, spinSpeeds = ['400', '800', '1200', '1600'], numberOfRinses = LaundryWasherControls.NumberOfRinses.Normal, supportedRinses = [LaundryWasherControls.NumberOfRinses.None, LaundryWasherControls.NumberOfRinses.Normal, LaundryWasherControls.NumberOfRinses.Max, LaundryWasherControls.NumberOfRinses.Extra]) {
38
102
  this.behaviors.require(LaundryWasherControlsServer.with(LaundryWasherControls.Feature.Spin, LaundryWasherControls.Feature.Rinse), {
39
103
  spinSpeeds,
40
- spinSpeedCurrent,
104
+ spinSpeedCurrent, // Writable and nullable
41
105
  supportedRinses,
42
- numberOfRinses,
106
+ numberOfRinses, // Writable
43
107
  });
44
108
  return this;
45
109
  }
@@ -50,6 +114,7 @@ export class MatterbridgeLaundryWasherModeServer extends LaundryWasherModeServer
50
114
  device.log.info(`MatterbridgeLaundryWasherModeServer initialized: currentMode is ${this.state.currentMode}`);
51
115
  this.reactTo(this.agent.get(MatterbridgeOnOffServer).events.onOff$Changed, this.handleOnOffChange);
52
116
  }
117
+ // Dead Front OnOff Cluster
53
118
  handleOnOffChange(onOff) {
54
119
  const device = this.endpoint.stateOf(MatterbridgeServer);
55
120
  device.log.info(`HandleOnOffChange (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
@@ -74,3 +139,4 @@ export class MatterbridgeLaundryWasherModeServer extends LaundryWasherModeServer
74
139
  }
75
140
  }
76
141
  }
142
+ //# sourceMappingURL=laundryWasher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"laundryWasher.js","sourceRoot":"","sources":["../../src/devices/laundryWasher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,OAAO,EAAE,qBAAqB,EAA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C,CAAC;YAClH,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,gBAAgB,CAAC,aAAa,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC;QACzF,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,168 @@
1
+ /**
2
+ * @description This file contains the MicrowaveOven class.
3
+ * @file src/devices/microwaveOven.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 { MicrowaveOvenMode } from '@matter/types/clusters/microwave-oven-mode';
25
+ import { MicrowaveOvenControl } from '@matter/types/clusters/microwave-oven-control';
26
+ import { MicrowaveOvenControlServer } from '@matter/node/behaviors/microwave-oven-control';
27
+ import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
28
+ export declare class MicrowaveOven extends MatterbridgeEndpoint {
29
+ /**
30
+ * Creates an instance of the MicrowaveOven class.
31
+ *
32
+ * @param {string} name - The name of the microwave oven.
33
+ * @param {string} serial - The serial number of the microwave oven.
34
+ * @param {number} currentMode - The current mode of the microwave oven. Default is 1 = Auto.
35
+ * @param {MicrowaveOvenMode.ModeOption[]} supportedModes - The supported modes of the microwave oven. Default is an array of all modes.
36
+ * @param {number} selectedWattIndex - The selected wattage index. Default is 5 (600W).
37
+ * @param {number[]} supportedWatts - The supported wattages. Default is an array of all standard microwave wattages.
38
+ * @param {number} cookTime - The initial cook time in seconds. Default is 60 seconds.
39
+ * @param {number} maxCookTime - The maximum cook time in seconds. Default is 3600 seconds (1 hour).
40
+ *
41
+ * @remarks
42
+ * - 8.12. Microwave Oven Mode Cluster
43
+ * - Exactly one entry in the SupportedModes attribute SHALL include the Normal mode tag in the ModeTags field.
44
+ * - The Normal and Defrost mode tags are mutually exclusive and SHALL NOT both be used together in a mode’s ModeTags.
45
+ */
46
+ constructor(name: string, serial: string, currentMode?: number, supportedModes?: MicrowaveOvenMode.ModeOption[], selectedWattIndex?: number, supportedWatts?: number[], cookTime?: number, // 1 minute
47
+ maxCookTime?: number);
48
+ /**
49
+ * Creates a default MicrowaveOvenMode Cluster Server.
50
+ * There is no changeToMode command in the spec, so this is not implemented.
51
+ * The Microwave is controlled by the MicrowaveOvenControl cluster.
52
+ *
53
+ * @param {number} currentMode - The current mode of the oven.
54
+ * @param {MicrowaveOvenMode.ModeOption[]} supportedModes - The supported modes.
55
+ *
56
+ * @returns {MatterbridgeEndpoint} The current MatterbridgeEndpoint instance for chaining.
57
+ *
58
+ * @remarks
59
+ * - 8.12. Microwave Oven Mode Cluster
60
+ * - the supported modes are fixed and cannot be changed at runtime.
61
+ * - the current mode is persistent among reboots.
62
+ * - Exactly one entry in the SupportedModes attribute SHALL include the Normal mode tag in the ModeTags field.
63
+ * - The Normal and Defrost mode tags are mutually exclusive and SHALL NOT both be used together in a mode’s ModeTags.
64
+ */
65
+ createDefaultMicrowaveOvenModeClusterServer(currentMode: number, supportedModes: MicrowaveOvenMode.ModeOption[]): this;
66
+ /**
67
+ * Creates a default MicrowaveOvenControl Cluster Server.
68
+ *
69
+ * @param {number} selectedWattIndex - The selected watt index.
70
+ * @param {number[]} supportedWatts - The supported watt values.
71
+ * @param {number} cookTime - The initial cook time.
72
+ * @param {number} maxCookTime - The maximum cook time.
73
+ *
74
+ * @returns {this} The current MatterbridgeEndpoint instance for chaining.
75
+ *
76
+ * @remarks
77
+ * - 8.13. Microwave Oven Control Cluster
78
+ * - the supported watt values are fixed and cannot be changed at runtime.
79
+ * - the maxCookTime is a fixed attribute and cannot be changed at runtime.
80
+ */
81
+ createDefaultMicrowaveOvenControlClusterServer(selectedWattIndex: number, supportedWatts: number[], cookTime: number, maxCookTime: number): this;
82
+ }
83
+ declare const MatterbridgeMicrowaveOvenControlServer_base: import("@matter/node").ClusterBehavior.Type<import("@matter/types").ClusterComposer.WithFeatures<import("@matter/types").ClusterType.Of<{
84
+ readonly id: 95;
85
+ readonly name: "MicrowaveOvenControl";
86
+ readonly revision: 1;
87
+ readonly features: {
88
+ readonly powerAsNumber: import("@matter/types").BitFlag;
89
+ readonly powerInWatts: import("@matter/types").BitFlag;
90
+ readonly powerNumberLimits: import("@matter/types").BitFlag;
91
+ };
92
+ readonly attributes: {
93
+ readonly cookTime: import("@matter/types").Attribute<number, any>;
94
+ readonly maxCookTime: import("@matter/types").FixedAttribute<number, any>;
95
+ readonly wattRating: import("@matter/types").OptionalFixedAttribute<number, any>;
96
+ };
97
+ readonly commands: {
98
+ readonly setCookingParameters: import("@matter/types").Command<import("@matter/types").TypeFromFields<{
99
+ cookMode: import("@matter/types").OptionalFieldType<number>;
100
+ cookTime: import("@matter/types").OptionalFieldType<number>;
101
+ powerSetting: import("@matter/types").OptionalFieldType<number>;
102
+ wattSettingIndex: import("@matter/types").OptionalFieldType<number>;
103
+ startAfterSetting: import("@matter/types").OptionalFieldType<boolean>;
104
+ }>, void, any>;
105
+ readonly addMoreTime: import("@matter/types").OptionalCommand<import("@matter/types").TypeFromFields<{
106
+ timeToAdd: import("@matter/types").FieldType<number>;
107
+ }>, void, any>;
108
+ };
109
+ readonly extensions: readonly [{
110
+ readonly flags: {
111
+ readonly powerAsNumber: true;
112
+ };
113
+ readonly component: {
114
+ readonly attributes: {
115
+ readonly powerSetting: import("@matter/types").Attribute<number, any>;
116
+ };
117
+ };
118
+ }, {
119
+ readonly flags: {
120
+ readonly powerNumberLimits: true;
121
+ };
122
+ readonly component: {
123
+ readonly attributes: {
124
+ readonly minPower: import("@matter/types").FixedAttribute<number, any>;
125
+ readonly maxPower: import("@matter/types").FixedAttribute<number, any>;
126
+ readonly powerStep: import("@matter/types").FixedAttribute<number, any>;
127
+ };
128
+ };
129
+ }, {
130
+ readonly flags: {
131
+ readonly powerInWatts: true;
132
+ };
133
+ readonly component: {
134
+ readonly attributes: {
135
+ readonly supportedWatts: import("@matter/types").FixedAttribute<number[], any>;
136
+ readonly selectedWattIndex: import("@matter/types").Attribute<number, any>;
137
+ };
138
+ };
139
+ }, {
140
+ readonly flags: {
141
+ readonly powerNumberLimits: true;
142
+ readonly powerAsNumber: false;
143
+ };
144
+ readonly component: false;
145
+ }, {
146
+ readonly flags: {
147
+ readonly powerAsNumber: true;
148
+ readonly powerInWatts: true;
149
+ };
150
+ readonly component: false;
151
+ }, {
152
+ readonly flags: {
153
+ readonly powerAsNumber: false;
154
+ readonly powerInWatts: false;
155
+ };
156
+ readonly component: false;
157
+ }];
158
+ }>, readonly [MicrowaveOvenControl.Feature.PowerInWatts]>, typeof MicrowaveOvenControlServer, import("@matter/node/behaviors/microwave-oven-control").MicrowaveOvenControlInterface>;
159
+ /**
160
+ * Matterbridge Microwave Oven Control Server
161
+ */
162
+ export declare class MatterbridgeMicrowaveOvenControlServer extends MatterbridgeMicrowaveOvenControlServer_base {
163
+ initialize(): void;
164
+ setCookingParameters(request: MicrowaveOvenControl.SetCookingParametersRequest): MaybePromise;
165
+ addMoreTime(request: MicrowaveOvenControl.AddMoreTimeRequest): MaybePromise;
166
+ }
167
+ export {};
168
+ //# sourceMappingURL=microwaveOven.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"microwaveOven.d.ts","sourceRoot":"","sources":["../../src/devices/microwaveOven.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AACrF,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAK3F,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAGlE,qBAAa,aAAc,SAAQ,oBAAoB;IACrD;;;;;;;;;;;;;;;;OAgBG;gBAED,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,WAAW,GAAE,MAAU,EACvB,cAAc,GAAE,iBAAiB,CAAC,UAAU,EAQ3C,EACD,iBAAiB,GAAE,MAAU,EAC7B,cAAc,GAAE,MAAM,EAAwD,EAC9E,QAAQ,GAAE,MAAW,EAAE,WAAW;IAClC,WAAW,GAAE,MAAa;IAW5B;;;;;;;;;;;;;;;;OAgBG;IACH,2CAA2C,CAAC,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,iBAAiB,CAAC,UAAU,EAAE,GAAG,IAAI;IAQtH;;;;;;;;;;;;;;OAcG;IACH,8CAA8C,CAAC,iBAAiB,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;CASjJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAED;;GAEG;AACH,qBAAa,sCAAuC,SAAQ,2CAA0E;IAC3H,UAAU;IAMV,oBAAoB,CAAC,OAAO,EAAE,oBAAoB,CAAC,2BAA2B,GAAG,YAAY;IA0C7F,WAAW,CAAC,OAAO,EAAE,oBAAoB,CAAC,kBAAkB,GAAG,YAAY;CAWrF"}
@@ -1,12 +1,52 @@
1
+ /**
2
+ * @description This file contains the MicrowaveOven class.
3
+ * @file src/devices/microwaveOven.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 { OperationalState } from '@matter/types/clusters/operational-state';
2
24
  import { MicrowaveOvenMode } from '@matter/types/clusters/microwave-oven-mode';
3
25
  import { MicrowaveOvenControl } from '@matter/types/clusters/microwave-oven-control';
4
26
  import { MicrowaveOvenControlServer } from '@matter/node/behaviors/microwave-oven-control';
5
27
  import { MicrowaveOvenModeServer } from '@matter/node/behaviors/microwave-oven-mode';
28
+ // Matterbridge
6
29
  import { microwaveOven, powerSource } from '../matterbridgeDeviceTypes.js';
7
30
  import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
8
31
  import { MatterbridgeServer, MatterbridgeOperationalStateServer } from '../matterbridgeBehaviors.js';
9
32
  export class MicrowaveOven extends MatterbridgeEndpoint {
33
+ /**
34
+ * Creates an instance of the MicrowaveOven class.
35
+ *
36
+ * @param {string} name - The name of the microwave oven.
37
+ * @param {string} serial - The serial number of the microwave oven.
38
+ * @param {number} currentMode - The current mode of the microwave oven. Default is 1 = Auto.
39
+ * @param {MicrowaveOvenMode.ModeOption[]} supportedModes - The supported modes of the microwave oven. Default is an array of all modes.
40
+ * @param {number} selectedWattIndex - The selected wattage index. Default is 5 (600W).
41
+ * @param {number[]} supportedWatts - The supported wattages. Default is an array of all standard microwave wattages.
42
+ * @param {number} cookTime - The initial cook time in seconds. Default is 60 seconds.
43
+ * @param {number} maxCookTime - The maximum cook time in seconds. Default is 3600 seconds (1 hour).
44
+ *
45
+ * @remarks
46
+ * - 8.12. Microwave Oven Mode Cluster
47
+ * - Exactly one entry in the SupportedModes attribute SHALL include the Normal mode tag in the ModeTags field.
48
+ * - The Normal and Defrost mode tags are mutually exclusive and SHALL NOT both be used together in a mode’s ModeTags.
49
+ */
10
50
  constructor(name, serial, currentMode = 1, supportedModes = [
11
51
  { label: 'Auto', mode: 1, modeTags: [{ value: MicrowaveOvenMode.ModeTag.Auto }] },
12
52
  { label: 'Quick', mode: 2, modeTags: [{ value: MicrowaveOvenMode.ModeTag.Quick }] },
@@ -15,7 +55,8 @@ export class MicrowaveOven extends MatterbridgeEndpoint {
15
55
  { label: 'Max', mode: 5, modeTags: [{ value: MicrowaveOvenMode.ModeTag.Max }] },
16
56
  { label: 'Normal', mode: 6, modeTags: [{ value: MicrowaveOvenMode.ModeTag.Normal }] },
17
57
  { label: 'Defrost', mode: 7, modeTags: [{ value: MicrowaveOvenMode.ModeTag.Defrost }] },
18
- ], selectedWattIndex = 5, supportedWatts = [100, 200, 300, 400, 500, 600, 700, 800, 900, 1000], cookTime = 60, maxCookTime = 3600) {
58
+ ], selectedWattIndex = 5, supportedWatts = [100, 200, 300, 400, 500, 600, 700, 800, 900, 1000], cookTime = 60, // 1 minute
59
+ maxCookTime = 3600) {
19
60
  super([microwaveOven, powerSource], { id: `${name.replaceAll(' ', '')}-${serial.replaceAll(' ', '')}` });
20
61
  this.createDefaultIdentifyClusterServer();
21
62
  this.createDefaultBasicInformationClusterServer(name, serial, 0xfff1, 'Matterbridge', 0x8000, 'Microwave Oven');
@@ -24,32 +65,69 @@ export class MicrowaveOven extends MatterbridgeEndpoint {
24
65
  this.createDefaultMicrowaveOvenModeClusterServer(currentMode, supportedModes);
25
66
  this.createDefaultMicrowaveOvenControlClusterServer(selectedWattIndex, supportedWatts, cookTime, maxCookTime);
26
67
  }
68
+ /**
69
+ * Creates a default MicrowaveOvenMode Cluster Server.
70
+ * There is no changeToMode command in the spec, so this is not implemented.
71
+ * The Microwave is controlled by the MicrowaveOvenControl cluster.
72
+ *
73
+ * @param {number} currentMode - The current mode of the oven.
74
+ * @param {MicrowaveOvenMode.ModeOption[]} supportedModes - The supported modes.
75
+ *
76
+ * @returns {MatterbridgeEndpoint} The current MatterbridgeEndpoint instance for chaining.
77
+ *
78
+ * @remarks
79
+ * - 8.12. Microwave Oven Mode Cluster
80
+ * - the supported modes are fixed and cannot be changed at runtime.
81
+ * - the current mode is persistent among reboots.
82
+ * - Exactly one entry in the SupportedModes attribute SHALL include the Normal mode tag in the ModeTags field.
83
+ * - The Normal and Defrost mode tags are mutually exclusive and SHALL NOT both be used together in a mode’s ModeTags.
84
+ */
27
85
  createDefaultMicrowaveOvenModeClusterServer(currentMode, supportedModes) {
28
86
  this.behaviors.require(MicrowaveOvenModeServer, {
29
- supportedModes,
30
- currentMode,
87
+ supportedModes, // Fixed attribute
88
+ currentMode, // Persistent attribute
31
89
  });
32
90
  return this;
33
91
  }
92
+ /**
93
+ * Creates a default MicrowaveOvenControl Cluster Server.
94
+ *
95
+ * @param {number} selectedWattIndex - The selected watt index.
96
+ * @param {number[]} supportedWatts - The supported watt values.
97
+ * @param {number} cookTime - The initial cook time.
98
+ * @param {number} maxCookTime - The maximum cook time.
99
+ *
100
+ * @returns {this} The current MatterbridgeEndpoint instance for chaining.
101
+ *
102
+ * @remarks
103
+ * - 8.13. Microwave Oven Control Cluster
104
+ * - the supported watt values are fixed and cannot be changed at runtime.
105
+ * - the maxCookTime is a fixed attribute and cannot be changed at runtime.
106
+ */
34
107
  createDefaultMicrowaveOvenControlClusterServer(selectedWattIndex, supportedWatts, cookTime, maxCookTime) {
35
108
  this.behaviors.require(MatterbridgeMicrowaveOvenControlServer.with(MicrowaveOvenControl.Feature.PowerInWatts), {
36
- supportedWatts,
109
+ supportedWatts, // Fixed attribute
37
110
  selectedWattIndex,
38
111
  cookTime,
39
- maxCookTime,
112
+ maxCookTime, // Fixed attribute
40
113
  });
41
114
  return this;
42
115
  }
43
116
  }
117
+ /**
118
+ * Matterbridge Microwave Oven Control Server
119
+ */
44
120
  export class MatterbridgeMicrowaveOvenControlServer extends MicrowaveOvenControlServer.with(MicrowaveOvenControl.Feature.PowerInWatts) {
45
121
  initialize() {
46
122
  const device = this.endpoint.stateOf(MatterbridgeServer);
47
123
  device.log.info('MatterbridgeMicrowaveOvenControlServer initialized');
48
124
  }
125
+ // 8.13.6.2. SetCookingParameters Command
49
126
  setCookingParameters(request) {
50
127
  const device = this.endpoint.stateOf(MatterbridgeServer);
51
128
  device.log.info(`MatterbridgeMicrowaveOvenControlServer: setCookingParameters (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
52
129
  device.commandHandler.executeHandler('setCookingParameters', { request, cluster: MicrowaveOvenControl.Cluster.id, attributes: this.state, endpoint: this.endpoint });
130
+ // 8.13.6.2.1. CookMode Field. Default to Normal mode if not present.
53
131
  if (request.cookMode !== undefined) {
54
132
  device.log.info(`MatterbridgeMicrowaveOvenControlServer: setCookingParameters called setting cookMode to ${request.cookMode}`);
55
133
  this.endpoint.setStateOf(MicrowaveOvenModeServer, { currentMode: request.cookMode });
@@ -60,6 +138,7 @@ export class MatterbridgeMicrowaveOvenControlServer extends MicrowaveOvenControl
60
138
  const normalMode = supportedModes.find((mode) => mode.modeTags.some((tag) => tag.value === MicrowaveOvenMode.ModeTag.Normal));
61
139
  this.endpoint.setStateOf(MicrowaveOvenModeServer, { currentMode: normalMode?.mode });
62
140
  }
141
+ // 8.13.6.2.2. CookTime Field. Default to 30 seconds.
63
142
  if (request.cookTime !== undefined && request.cookTime >= 0 && request.cookTime <= this.state.maxCookTime) {
64
143
  device.log.info(`MatterbridgeMicrowaveOvenControlServer: setCookingParameters called setting cookTime to ${request.cookTime}`);
65
144
  this.state.cookTime = request.cookTime;
@@ -68,6 +147,7 @@ export class MatterbridgeMicrowaveOvenControlServer extends MicrowaveOvenControl
68
147
  device.log.info(`MatterbridgeMicrowaveOvenControlServer: setCookingParameters called with no cookTime so set to 30sec.`);
69
148
  this.state.cookTime = 30;
70
149
  }
150
+ // 8.13.6.2.4. WattSettingIndex Field. Default the highest Watt setting for the selected CookMode.
71
151
  if (request.wattSettingIndex !== undefined && request.wattSettingIndex >= 0 && request.wattSettingIndex < this.state.supportedWatts.length) {
72
152
  device.log.info(`MatterbridgeMicrowaveOvenControlServer: setCookingParameters called setting selectedWattIndex to ${request.wattSettingIndex}`);
73
153
  this.state.selectedWattIndex = request.wattSettingIndex;
@@ -76,11 +156,13 @@ export class MatterbridgeMicrowaveOvenControlServer extends MicrowaveOvenControl
76
156
  device.log.info(`MatterbridgeMicrowaveOvenControlServer: setCookingParameters called with no wattSettingIndex so set to the highest Watt setting for the selected CookMode`);
77
157
  this.state.selectedWattIndex = this.state.supportedWatts.length - 1;
78
158
  }
159
+ // 8.13.6.2.5. StartAfterSetting Field. Default to false.
79
160
  if (request.startAfterSetting === true) {
80
161
  device.log.info(`MatterbridgeMicrowaveOvenControlServer: setCookingParameters called setting startAfterSetting = true`);
81
162
  this.endpoint.setStateOf(MatterbridgeOperationalStateServer, { operationalState: OperationalState.OperationalStateEnum.Running });
82
163
  }
83
164
  }
165
+ // 8.13.6.3. AddMoreTime Command
84
166
  addMoreTime(request) {
85
167
  const device = this.endpoint.stateOf(MatterbridgeServer);
86
168
  device.log.info(`MatterbridgeMicrowaveOvenControlServer: addMoreTime (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
@@ -94,3 +176,4 @@ export class MatterbridgeMicrowaveOvenControlServer extends MicrowaveOvenControl
94
176
  }
95
177
  }
96
178
  }
179
+ //# sourceMappingURL=microwaveOven.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"microwaveOven.js","sourceRoot":"","sources":["../../src/devices/microwaveOven.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM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C,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC5J,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS,IAAI,OAAO,CAAC,SAAS,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC,SAAS,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;YAClI,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,kFAAkF,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;YAC7I,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,OAAO,CAAC,SAAS,CAAC;QAC3C,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,oFAAoF,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;QAC5H,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,105 @@
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
+ import { MaybePromise } from '@matter/general';
24
+ import { Semtag } from '@matter/types';
25
+ import { ModeBase } from '@matter/types/clusters/mode-base';
26
+ import { OvenMode } from '@matter/types/clusters/oven-mode';
27
+ import { OperationalState } from '@matter/types/clusters/operational-state';
28
+ import { OvenModeServer } from '@matter/node/behaviors/oven-mode';
29
+ import { OvenCavityOperationalStateServer } from '@matter/node/behaviors/oven-cavity-operational-state';
30
+ import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
31
+ export declare class Oven extends MatterbridgeEndpoint {
32
+ /**
33
+ * Creates an instance of the Oven class.
34
+ *
35
+ * @param {string} name - The name of the oven.
36
+ * @param {string} serial - The serial number of the oven.
37
+ *
38
+ * @remarks
39
+ * 13.9 An oven represents a device that contains one or more cabinets, and optionally a single cooktop,
40
+ * that are all capable of heating food. Examples of consumer products implementing this device type
41
+ * include ovens, wall ovens, convection ovens, etc.
42
+ * An oven is always defined via endpoint composition.
43
+ * - Use `addCabinet` to add one or more cabinets to the oven.
44
+ */
45
+ constructor(name: string, serial: string);
46
+ /**
47
+ * Adds a Temperature Controlled Cabinet Heater to the oven.
48
+ *
49
+ * @param {string} name - The name of the cabinet.
50
+ * @param {Semtag[]} tagList - The tagList associated with the cabinet.
51
+ * @param {number} currentMode - The current mode of the cabinet. Defaults to 2 (which corresponds to 'Convection').
52
+ * @param {OvenMode.ModeOption[]} supportedModes - The supported modes of the cabinet. Defaults to a set of common oven modes.
53
+ * @param {number} selectedTemperatureLevel - The selected temperature level as an index of the supportedTemperatureLevels array. Defaults to 1 (which corresponds to 'Warm').
54
+ * @param {string[]} supportedTemperatureLevels - The list of supported temperature levels for the cabinet. Defaults to ['Defrost', '180°', '190°', '200°', '250°', '300°'].
55
+ * @param {OperationalState.OperationalStateEnum} operationalState - The initial operational state of the cabinet. Defaults to Stopped.
56
+ * @param {number} [currentPhase] - Optional: the current phase of the cabinet.
57
+ * @param {string[]} [phaseList] - Optional: the list of phases for the cabinet.
58
+ *
59
+ * @returns {MatterbridgeEndpoint} The MatterbridgeEndpoint instance representing the cabinet.
60
+ *
61
+ * @remarks
62
+ * 13.4.1 A Temperature Controlled Cabinet Heater is a device that provides a heated space for warming food.
63
+ * It is typically installed within an oven and can be used in conjunction with other heating elements.
64
+ */
65
+ addCabinet(name: string, tagList: Semtag[], currentMode?: number, supportedModes?: OvenMode.ModeOption[], selectedTemperatureLevel?: number, supportedTemperatureLevels?: string[], operationalState?: OperationalState.OperationalStateEnum, currentPhase?: number, phaseList?: string[]): MatterbridgeEndpoint;
66
+ /**
67
+ * Creates a default OvenMode Cluster Server.
68
+ *
69
+ * @param {MatterbridgeEndpoint} endpoint - The Matterbridge endpoint instance.
70
+ * @param {number} currentMode - The current mode of the oven.
71
+ * @param {OvenMode.ModeOption[]} supportedModes - The supported modes of the oven.
72
+ *
73
+ * @returns {MatterbridgeEndpoint} The current MatterbridgeEndpoint instance for chaining.
74
+ *
75
+ * @remarks
76
+ * - supportedModes is a fixed attribute. It cannot be changed at runtime.
77
+ * - currentMode persists across reboots.
78
+ */
79
+ createDefaultOvenModeClusterServer(endpoint: MatterbridgeEndpoint, currentMode: number, supportedModes: OvenMode.ModeOption[]): MatterbridgeEndpoint;
80
+ /**
81
+ * Creates a default Oven Cavity Operational State Cluster Server.
82
+ *
83
+ * @param {MatterbridgeEndpoint} endpoint - The Matterbridge endpoint instance.
84
+ * @param {OperationalState.OperationalStateEnum} operationalState - The initial operational state.
85
+ * @param {number} [currentPhase] - The current phase of the oven cavity.
86
+ * @param {string[]} [phaseList] - The list of phases for the oven cavity.
87
+ *
88
+ * @returns {this} The current MatterbridgeEndpoint instance for chaining.
89
+ *
90
+ * @remarks
91
+ * For this derived cluster, only these pre-defined strings may be used in the PhaseList attribute:
92
+ * "pre-heating", "pre-heated", and "cooling down".
93
+ */
94
+ createDefaultOvenCavityOperationalStateClusterServer(endpoint: MatterbridgeEndpoint, operationalState?: OperationalState.OperationalStateEnum, currentPhase?: number, phaseList?: string[]): MatterbridgeEndpoint;
95
+ }
96
+ export declare class MatterbridgeOvenModeServer extends OvenModeServer {
97
+ initialize(): void;
98
+ changeToMode(request: ModeBase.ChangeToModeRequest): MaybePromise<ModeBase.ChangeToModeResponse>;
99
+ }
100
+ export declare class MatterbridgeOvenCavityOperationalStateServer extends OvenCavityOperationalStateServer {
101
+ initialize(): void;
102
+ stop(): MaybePromise<OperationalState.OperationalCommandResponse>;
103
+ start(): MaybePromise<OperationalState.OperationalCommandResponse>;
104
+ }
105
+ //# sourceMappingURL=oven.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oven.d.ts","sourceRoot":"","sources":["../../src/devices/oven.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,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;AAIxG,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAKlE,qBAAa,IAAK,SAAQ,oBAAoB;IAC5C;;;;;;;;;;;;OAYG;gBACS,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAQxC;;;;;;;;;;;;;;;;;;OAkBG;IACH,UAAU,CACR,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EAAE,EACjB,WAAW,GAAE,MAAU,EACvB,cAAc,GAAE,QAAQ,CAAC,UAAU,EAWlC,EACD,wBAAwB,GAAE,MAAU,EACpC,0BAA0B,GAAE,MAAM,EAAwD,EAC1F,gBAAgB,GAAE,gBAAgB,CAAC,oBAAoE,EACvG,YAAY,CAAC,EAAE,MAAM,EACrB,SAAS,CAAC,EAAE,MAAM,EAAE,GACnB,oBAAoB;IAWvB;;;;;;;;;;;;O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