matterbridge 3.2.3 → 3.2.4-dev-20250828-cf98212

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 (267) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cli.js +2 -91
  3. package/dist/cliEmitter.js +0 -30
  4. package/dist/clusters/export.js +0 -2
  5. package/dist/defaultConfigSchema.js +0 -24
  6. package/dist/deviceManager.js +1 -94
  7. package/dist/devices/batteryStorage.js +1 -48
  8. package/dist/devices/cooktop.js +0 -55
  9. package/dist/devices/dishwasher.js +0 -57
  10. package/dist/devices/evse.js +10 -74
  11. package/dist/devices/export.js +0 -4
  12. package/dist/devices/extractorHood.js +0 -42
  13. package/dist/devices/heatPump.js +2 -50
  14. package/dist/devices/laundryDryer.js +3 -62
  15. package/dist/devices/laundryWasher.js +4 -70
  16. package/dist/devices/microwaveOven.js +5 -88
  17. package/dist/devices/oven.js +0 -85
  18. package/dist/devices/refrigerator.js +0 -80
  19. package/dist/devices/roboticVacuumCleaner.js +7 -93
  20. package/dist/devices/solarPower.js +0 -38
  21. package/dist/devices/temperatureControl.js +3 -25
  22. package/dist/devices/waterHeater.js +2 -82
  23. package/dist/dgram/coap.js +13 -126
  24. package/dist/dgram/dgram.js +2 -113
  25. package/dist/dgram/mb_coap.js +3 -41
  26. package/dist/dgram/mb_mdns.js +13 -51
  27. package/dist/dgram/mdns.js +137 -298
  28. package/dist/dgram/multicast.js +1 -60
  29. package/dist/dgram/unicast.js +0 -54
  30. package/dist/frontend.js +24 -451
  31. package/dist/globalMatterbridge.js +0 -47
  32. package/dist/helpers.js +0 -53
  33. package/dist/index.js +1 -30
  34. package/dist/logger/export.js +0 -1
  35. package/dist/matter/behaviors.js +0 -2
  36. package/dist/matter/clusters.js +0 -2
  37. package/dist/matter/devices.js +0 -2
  38. package/dist/matter/endpoints.js +0 -2
  39. package/dist/matter/export.js +0 -3
  40. package/dist/matter/types.js +0 -3
  41. package/dist/matterbridge.js +50 -789
  42. package/dist/matterbridgeAccessoryPlatform.js +0 -36
  43. package/dist/matterbridgeBehaviors.js +5 -65
  44. package/dist/matterbridgeDeviceTypes.js +15 -579
  45. package/dist/matterbridgeDynamicPlatform.js +0 -36
  46. package/dist/matterbridgeEndpoint.js +54 -1220
  47. package/dist/matterbridgeEndpointHelpers.js +12 -345
  48. package/dist/matterbridgePlatform.js +4 -250
  49. package/dist/matterbridgeTypes.js +0 -25
  50. package/dist/pluginManager.js +3 -249
  51. package/dist/shelly.js +7 -168
  52. package/dist/storage/export.js +0 -1
  53. package/dist/update.js +0 -69
  54. package/dist/utils/colorUtils.js +2 -97
  55. package/dist/utils/commandLine.js +0 -54
  56. package/dist/utils/copyDirectory.js +1 -38
  57. package/dist/utils/createDirectory.js +0 -33
  58. package/dist/utils/createZip.js +2 -47
  59. package/dist/utils/deepCopy.js +0 -39
  60. package/dist/utils/deepEqual.js +1 -72
  61. package/dist/utils/error.js +0 -41
  62. package/dist/utils/export.js +0 -1
  63. package/dist/utils/hex.js +0 -124
  64. package/dist/utils/isvalid.js +0 -101
  65. package/dist/utils/network.js +5 -91
  66. package/dist/utils/spawn.js +0 -40
  67. package/dist/utils/wait.js +8 -60
  68. package/npm-shrinkwrap.json +2 -2
  69. package/package.json +1 -2
  70. package/dist/cli.d.ts +0 -26
  71. package/dist/cli.d.ts.map +0 -1
  72. package/dist/cli.js.map +0 -1
  73. package/dist/cliEmitter.d.ts +0 -34
  74. package/dist/cliEmitter.d.ts.map +0 -1
  75. package/dist/cliEmitter.js.map +0 -1
  76. package/dist/clusters/export.d.ts +0 -2
  77. package/dist/clusters/export.d.ts.map +0 -1
  78. package/dist/clusters/export.js.map +0 -1
  79. package/dist/defaultConfigSchema.d.ts +0 -28
  80. package/dist/defaultConfigSchema.d.ts.map +0 -1
  81. package/dist/defaultConfigSchema.js.map +0 -1
  82. package/dist/deviceManager.d.ts +0 -112
  83. package/dist/deviceManager.d.ts.map +0 -1
  84. package/dist/deviceManager.js.map +0 -1
  85. package/dist/devices/batteryStorage.d.ts +0 -48
  86. package/dist/devices/batteryStorage.d.ts.map +0 -1
  87. package/dist/devices/batteryStorage.js.map +0 -1
  88. package/dist/devices/cooktop.d.ts +0 -60
  89. package/dist/devices/cooktop.d.ts.map +0 -1
  90. package/dist/devices/cooktop.js.map +0 -1
  91. package/dist/devices/dishwasher.d.ts +0 -71
  92. package/dist/devices/dishwasher.d.ts.map +0 -1
  93. package/dist/devices/dishwasher.js.map +0 -1
  94. package/dist/devices/evse.d.ts +0 -75
  95. package/dist/devices/evse.d.ts.map +0 -1
  96. package/dist/devices/evse.js.map +0 -1
  97. package/dist/devices/export.d.ts +0 -15
  98. package/dist/devices/export.d.ts.map +0 -1
  99. package/dist/devices/export.js.map +0 -1
  100. package/dist/devices/extractorHood.d.ts +0 -46
  101. package/dist/devices/extractorHood.d.ts.map +0 -1
  102. package/dist/devices/extractorHood.js.map +0 -1
  103. package/dist/devices/heatPump.d.ts +0 -47
  104. package/dist/devices/heatPump.d.ts.map +0 -1
  105. package/dist/devices/heatPump.js.map +0 -1
  106. package/dist/devices/laundryDryer.d.ts +0 -67
  107. package/dist/devices/laundryDryer.d.ts.map +0 -1
  108. package/dist/devices/laundryDryer.js.map +0 -1
  109. package/dist/devices/laundryWasher.d.ts +0 -81
  110. package/dist/devices/laundryWasher.d.ts.map +0 -1
  111. package/dist/devices/laundryWasher.js.map +0 -1
  112. package/dist/devices/microwaveOven.d.ts +0 -168
  113. package/dist/devices/microwaveOven.d.ts.map +0 -1
  114. package/dist/devices/microwaveOven.js.map +0 -1
  115. package/dist/devices/oven.d.ts +0 -105
  116. package/dist/devices/oven.d.ts.map +0 -1
  117. package/dist/devices/oven.js.map +0 -1
  118. package/dist/devices/refrigerator.d.ts +0 -93
  119. package/dist/devices/refrigerator.d.ts.map +0 -1
  120. package/dist/devices/refrigerator.js.map +0 -1
  121. package/dist/devices/roboticVacuumCleaner.d.ts +0 -112
  122. package/dist/devices/roboticVacuumCleaner.d.ts.map +0 -1
  123. package/dist/devices/roboticVacuumCleaner.js.map +0 -1
  124. package/dist/devices/solarPower.d.ts +0 -40
  125. package/dist/devices/solarPower.d.ts.map +0 -1
  126. package/dist/devices/solarPower.js.map +0 -1
  127. package/dist/devices/temperatureControl.d.ts +0 -166
  128. package/dist/devices/temperatureControl.d.ts.map +0 -1
  129. package/dist/devices/temperatureControl.js.map +0 -1
  130. package/dist/devices/waterHeater.d.ts +0 -111
  131. package/dist/devices/waterHeater.d.ts.map +0 -1
  132. package/dist/devices/waterHeater.js.map +0 -1
  133. package/dist/dgram/coap.d.ts +0 -205
  134. package/dist/dgram/coap.d.ts.map +0 -1
  135. package/dist/dgram/coap.js.map +0 -1
  136. package/dist/dgram/dgram.d.ts +0 -140
  137. package/dist/dgram/dgram.d.ts.map +0 -1
  138. package/dist/dgram/dgram.js.map +0 -1
  139. package/dist/dgram/mb_coap.d.ts +0 -24
  140. package/dist/dgram/mb_coap.d.ts.map +0 -1
  141. package/dist/dgram/mb_coap.js.map +0 -1
  142. package/dist/dgram/mb_mdns.d.ts +0 -24
  143. package/dist/dgram/mb_mdns.d.ts.map +0 -1
  144. package/dist/dgram/mb_mdns.js.map +0 -1
  145. package/dist/dgram/mdns.d.ts +0 -288
  146. package/dist/dgram/mdns.d.ts.map +0 -1
  147. package/dist/dgram/mdns.js.map +0 -1
  148. package/dist/dgram/multicast.d.ts +0 -65
  149. package/dist/dgram/multicast.d.ts.map +0 -1
  150. package/dist/dgram/multicast.js.map +0 -1
  151. package/dist/dgram/unicast.d.ts +0 -56
  152. package/dist/dgram/unicast.d.ts.map +0 -1
  153. package/dist/dgram/unicast.js.map +0 -1
  154. package/dist/frontend.d.ts +0 -313
  155. package/dist/frontend.d.ts.map +0 -1
  156. package/dist/frontend.js.map +0 -1
  157. package/dist/globalMatterbridge.d.ts +0 -59
  158. package/dist/globalMatterbridge.d.ts.map +0 -1
  159. package/dist/globalMatterbridge.js.map +0 -1
  160. package/dist/helpers.d.ts +0 -48
  161. package/dist/helpers.d.ts.map +0 -1
  162. package/dist/helpers.js.map +0 -1
  163. package/dist/index.d.ts +0 -33
  164. package/dist/index.d.ts.map +0 -1
  165. package/dist/index.js.map +0 -1
  166. package/dist/logger/export.d.ts +0 -2
  167. package/dist/logger/export.d.ts.map +0 -1
  168. package/dist/logger/export.js.map +0 -1
  169. package/dist/matter/behaviors.d.ts +0 -2
  170. package/dist/matter/behaviors.d.ts.map +0 -1
  171. package/dist/matter/behaviors.js.map +0 -1
  172. package/dist/matter/clusters.d.ts +0 -2
  173. package/dist/matter/clusters.d.ts.map +0 -1
  174. package/dist/matter/clusters.js.map +0 -1
  175. package/dist/matter/devices.d.ts +0 -2
  176. package/dist/matter/devices.d.ts.map +0 -1
  177. package/dist/matter/devices.js.map +0 -1
  178. package/dist/matter/endpoints.d.ts +0 -2
  179. package/dist/matter/endpoints.d.ts.map +0 -1
  180. package/dist/matter/endpoints.js.map +0 -1
  181. package/dist/matter/export.d.ts +0 -5
  182. package/dist/matter/export.d.ts.map +0 -1
  183. package/dist/matter/export.js.map +0 -1
  184. package/dist/matter/types.d.ts +0 -3
  185. package/dist/matter/types.d.ts.map +0 -1
  186. package/dist/matter/types.js.map +0 -1
  187. package/dist/matterbridge.d.ts +0 -462
  188. package/dist/matterbridge.d.ts.map +0 -1
  189. package/dist/matterbridge.js.map +0 -1
  190. package/dist/matterbridgeAccessoryPlatform.d.ts +0 -42
  191. package/dist/matterbridgeAccessoryPlatform.d.ts.map +0 -1
  192. package/dist/matterbridgeAccessoryPlatform.js.map +0 -1
  193. package/dist/matterbridgeBehaviors.d.ts +0 -1351
  194. package/dist/matterbridgeBehaviors.d.ts.map +0 -1
  195. package/dist/matterbridgeBehaviors.js.map +0 -1
  196. package/dist/matterbridgeDeviceTypes.d.ts +0 -709
  197. package/dist/matterbridgeDeviceTypes.d.ts.map +0 -1
  198. package/dist/matterbridgeDeviceTypes.js.map +0 -1
  199. package/dist/matterbridgeDynamicPlatform.d.ts +0 -42
  200. package/dist/matterbridgeDynamicPlatform.d.ts.map +0 -1
  201. package/dist/matterbridgeDynamicPlatform.js.map +0 -1
  202. package/dist/matterbridgeEndpoint.d.ts +0 -1356
  203. package/dist/matterbridgeEndpoint.d.ts.map +0 -1
  204. package/dist/matterbridgeEndpoint.js.map +0 -1
  205. package/dist/matterbridgeEndpointHelpers.d.ts +0 -407
  206. package/dist/matterbridgeEndpointHelpers.d.ts.map +0 -1
  207. package/dist/matterbridgeEndpointHelpers.js.map +0 -1
  208. package/dist/matterbridgePlatform.d.ts +0 -324
  209. package/dist/matterbridgePlatform.d.ts.map +0 -1
  210. package/dist/matterbridgePlatform.js.map +0 -1
  211. package/dist/matterbridgeTypes.d.ts +0 -198
  212. package/dist/matterbridgeTypes.d.ts.map +0 -1
  213. package/dist/matterbridgeTypes.js.map +0 -1
  214. package/dist/pluginManager.d.ts +0 -270
  215. package/dist/pluginManager.d.ts.map +0 -1
  216. package/dist/pluginManager.js.map +0 -1
  217. package/dist/shelly.d.ts +0 -174
  218. package/dist/shelly.d.ts.map +0 -1
  219. package/dist/shelly.js.map +0 -1
  220. package/dist/storage/export.d.ts +0 -2
  221. package/dist/storage/export.d.ts.map +0 -1
  222. package/dist/storage/export.js.map +0 -1
  223. package/dist/update.d.ts +0 -75
  224. package/dist/update.d.ts.map +0 -1
  225. package/dist/update.js.map +0 -1
  226. package/dist/utils/colorUtils.d.ts +0 -99
  227. package/dist/utils/colorUtils.d.ts.map +0 -1
  228. package/dist/utils/colorUtils.js.map +0 -1
  229. package/dist/utils/commandLine.d.ts +0 -59
  230. package/dist/utils/commandLine.d.ts.map +0 -1
  231. package/dist/utils/commandLine.js.map +0 -1
  232. package/dist/utils/copyDirectory.d.ts +0 -33
  233. package/dist/utils/copyDirectory.d.ts.map +0 -1
  234. package/dist/utils/copyDirectory.js.map +0 -1
  235. package/dist/utils/createDirectory.d.ts +0 -34
  236. package/dist/utils/createDirectory.d.ts.map +0 -1
  237. package/dist/utils/createDirectory.js.map +0 -1
  238. package/dist/utils/createZip.d.ts +0 -39
  239. package/dist/utils/createZip.d.ts.map +0 -1
  240. package/dist/utils/createZip.js.map +0 -1
  241. package/dist/utils/deepCopy.d.ts +0 -32
  242. package/dist/utils/deepCopy.d.ts.map +0 -1
  243. package/dist/utils/deepCopy.js.map +0 -1
  244. package/dist/utils/deepEqual.d.ts +0 -54
  245. package/dist/utils/deepEqual.d.ts.map +0 -1
  246. package/dist/utils/deepEqual.js.map +0 -1
  247. package/dist/utils/error.d.ts +0 -44
  248. package/dist/utils/error.d.ts.map +0 -1
  249. package/dist/utils/error.js.map +0 -1
  250. package/dist/utils/export.d.ts +0 -12
  251. package/dist/utils/export.d.ts.map +0 -1
  252. package/dist/utils/export.js.map +0 -1
  253. package/dist/utils/hex.d.ts +0 -89
  254. package/dist/utils/hex.d.ts.map +0 -1
  255. package/dist/utils/hex.js.map +0 -1
  256. package/dist/utils/isvalid.d.ts +0 -103
  257. package/dist/utils/isvalid.d.ts.map +0 -1
  258. package/dist/utils/isvalid.js.map +0 -1
  259. package/dist/utils/network.d.ts +0 -84
  260. package/dist/utils/network.d.ts.map +0 -1
  261. package/dist/utils/network.js.map +0 -1
  262. package/dist/utils/spawn.d.ts +0 -33
  263. package/dist/utils/spawn.d.ts.map +0 -1
  264. package/dist/utils/spawn.js.map +0 -1
  265. package/dist/utils/wait.d.ts +0 -54
  266. package/dist/utils/wait.d.ts.map +0 -1
  267. package/dist/utils/wait.js.map +0 -1
@@ -1,52 +1,12 @@
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
1
  import { OperationalState } from '@matter/main/clusters/operational-state';
24
2
  import { MicrowaveOvenMode } from '@matter/main/clusters/microwave-oven-mode';
25
3
  import { MicrowaveOvenControl } from '@matter/main/clusters/microwave-oven-control';
26
4
  import { MicrowaveOvenControlServer } from '@matter/main/behaviors/microwave-oven-control';
27
5
  import { MicrowaveOvenModeServer } from '@matter/main/behaviors/microwave-oven-mode';
28
- // Matterbridge
29
6
  import { microwaveOven, powerSource } from '../matterbridgeDeviceTypes.js';
30
7
  import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
31
8
  import { MatterbridgeServer, MatterbridgeOperationalStateServer } from '../matterbridgeBehaviors.js';
32
9
  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
- */
50
10
  constructor(name, serial, currentMode = 1, supportedModes = [
51
11
  { label: 'Auto', mode: 1, modeTags: [{ value: MicrowaveOvenMode.ModeTag.Auto }] },
52
12
  { label: 'Quick', mode: 2, modeTags: [{ value: MicrowaveOvenMode.ModeTag.Quick }] },
@@ -55,8 +15,7 @@ export class MicrowaveOven extends MatterbridgeEndpoint {
55
15
  { label: 'Max', mode: 5, modeTags: [{ value: MicrowaveOvenMode.ModeTag.Max }] },
56
16
  { label: 'Normal', mode: 6, modeTags: [{ value: MicrowaveOvenMode.ModeTag.Normal }] },
57
17
  { label: 'Defrost', mode: 7, modeTags: [{ value: MicrowaveOvenMode.ModeTag.Defrost }] },
58
- ], selectedWattIndex = 5, supportedWatts = [100, 200, 300, 400, 500, 600, 700, 800, 900, 1000], cookTime = 60, // 1 minute
59
- maxCookTime = 3600) {
18
+ ], selectedWattIndex = 5, supportedWatts = [100, 200, 300, 400, 500, 600, 700, 800, 900, 1000], cookTime = 60, maxCookTime = 3600) {
60
19
  super([microwaveOven, powerSource], { uniqueStorageKey: `${name.replaceAll(' ', '')}-${serial.replaceAll(' ', '')}` }, true);
61
20
  this.createDefaultIdentifyClusterServer();
62
21
  this.createDefaultBasicInformationClusterServer(name, serial, 0xfff1, 'Matterbridge', 0x8000, 'Microwave Oven');
@@ -65,69 +24,32 @@ export class MicrowaveOven extends MatterbridgeEndpoint {
65
24
  this.createDefaultMicrowaveOvenModeClusterServer(currentMode, supportedModes);
66
25
  this.createDefaultMicrowaveOvenControlClusterServer(selectedWattIndex, supportedWatts, cookTime, maxCookTime);
67
26
  }
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
- */
85
27
  createDefaultMicrowaveOvenModeClusterServer(currentMode, supportedModes) {
86
28
  this.behaviors.require(MicrowaveOvenModeServer, {
87
- supportedModes, // Fixed attribute
88
- currentMode, // Persistent attribute
29
+ supportedModes,
30
+ currentMode,
89
31
  });
90
32
  return this;
91
33
  }
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
- */
107
34
  createDefaultMicrowaveOvenControlClusterServer(selectedWattIndex, supportedWatts, cookTime, maxCookTime) {
108
35
  this.behaviors.require(MatterbridgeMicrowaveOvenControlServer.with(MicrowaveOvenControl.Feature.PowerInWatts), {
109
- supportedWatts, // Fixed attribute
36
+ supportedWatts,
110
37
  selectedWattIndex,
111
38
  cookTime,
112
- maxCookTime, // Fixed attribute
39
+ maxCookTime,
113
40
  });
114
41
  return this;
115
42
  }
116
43
  }
117
- /**
118
- * Matterbridge Microwave Oven Control Server
119
- */
120
44
  export class MatterbridgeMicrowaveOvenControlServer extends MicrowaveOvenControlServer.with(MicrowaveOvenControl.Feature.PowerInWatts) {
121
45
  initialize() {
122
46
  const device = this.endpoint.stateOf(MatterbridgeServer);
123
47
  device.log.info('MatterbridgeMicrowaveOvenControlServer initialized');
124
48
  }
125
- // 8.13.6.2. SetCookingParameters Command
126
49
  setCookingParameters(request) {
127
50
  const device = this.endpoint.stateOf(MatterbridgeServer);
128
51
  device.log.info(`MatterbridgeMicrowaveOvenControlServer: setCookingParameters (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
129
52
  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.
131
53
  if (request.cookMode !== undefined) {
132
54
  device.log.info(`MatterbridgeMicrowaveOvenControlServer: setCookingParameters called setting cookMode to ${request.cookMode}`);
133
55
  this.endpoint.setStateOf(MicrowaveOvenModeServer, { currentMode: request.cookMode });
@@ -138,7 +60,6 @@ export class MatterbridgeMicrowaveOvenControlServer extends MicrowaveOvenControl
138
60
  const normalMode = supportedModes.find((mode) => mode.modeTags.some((tag) => tag.value === MicrowaveOvenMode.ModeTag.Normal));
139
61
  this.endpoint.setStateOf(MicrowaveOvenModeServer, { currentMode: normalMode?.mode });
140
62
  }
141
- // 8.13.6.2.2. CookTime Field. Default to 30 seconds.
142
63
  if (request.cookTime !== undefined && request.cookTime >= 0 && request.cookTime <= this.state.maxCookTime) {
143
64
  device.log.info(`MatterbridgeMicrowaveOvenControlServer: setCookingParameters called setting cookTime to ${request.cookTime}`);
144
65
  this.state.cookTime = request.cookTime;
@@ -147,7 +68,6 @@ export class MatterbridgeMicrowaveOvenControlServer extends MicrowaveOvenControl
147
68
  device.log.info(`MatterbridgeMicrowaveOvenControlServer: setCookingParameters called with no cookTime so set to 30sec.`);
148
69
  this.state.cookTime = 30;
149
70
  }
150
- // 8.13.6.2.4. WattSettingIndex Field. Default the highest Watt setting for the selected CookMode.
151
71
  if (request.wattSettingIndex !== undefined && request.wattSettingIndex >= 0 && request.wattSettingIndex < this.state.supportedWatts.length) {
152
72
  device.log.info(`MatterbridgeMicrowaveOvenControlServer: setCookingParameters called setting selectedWattIndex to ${request.wattSettingIndex}`);
153
73
  this.state.selectedWattIndex = request.wattSettingIndex;
@@ -156,13 +76,11 @@ export class MatterbridgeMicrowaveOvenControlServer extends MicrowaveOvenControl
156
76
  device.log.info(`MatterbridgeMicrowaveOvenControlServer: setCookingParameters called with no wattSettingIndex so set to the highest Watt setting for the selected CookMode`);
157
77
  this.state.selectedWattIndex = this.state.supportedWatts.length - 1;
158
78
  }
159
- // 8.13.6.2.5. StartAfterSetting Field. Default to false.
160
79
  if (request.startAfterSetting === true) {
161
80
  device.log.info(`MatterbridgeMicrowaveOvenControlServer: setCookingParameters called setting startAfterSetting = true`);
162
81
  this.endpoint.setStateOf(MatterbridgeOperationalStateServer, { operationalState: OperationalState.OperationalStateEnum.Running });
163
82
  }
164
83
  }
165
- // 8.13.6.3. AddMoreTime Command
166
84
  addMoreTime(request) {
167
85
  const device = this.endpoint.stateOf(MatterbridgeServer);
168
86
  device.log.info(`MatterbridgeMicrowaveOvenControlServer: addMoreTime (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
@@ -176,4 +94,3 @@ export class MatterbridgeMicrowaveOvenControlServer extends MicrowaveOvenControl
176
94
  }
177
95
  }
178
96
  }
179
- //# sourceMappingURL=microwaveOven.js.map
@@ -1,49 +1,13 @@
1
- /**
2
- * @description This file contains the Oven class.
3
- * @file src/devices/oven.ts
4
- * @author Luca Liguori
5
- * @created 2025-05-25
6
- * @version 1.1.0
7
- * @license Apache-2.0
8
- *
9
- * Copyright 2025, 2026, 2027 Luca Liguori.
10
- *
11
- * Licensed under the Apache License, Version 2.0 (the "License");
12
- * you may not use this file except in compliance with the License.
13
- * You may obtain a copy of the License at
14
- *
15
- * http://www.apache.org/licenses/LICENSE-2.0
16
- *
17
- * Unless required by applicable law or agreed to in writing, software
18
- * distributed under the License is distributed on an "AS IS" BASIS,
19
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
- * See the License for the specific language governing permissions and
21
- * limitations under the License.
22
- */
23
1
  import { ModeBase } from '@matter/main/clusters/mode-base';
24
2
  import { OvenMode } from '@matter/main/clusters/oven-mode';
25
3
  import { OperationalState } from '@matter/main/clusters/operational-state';
26
4
  import { OvenModeServer } from '@matter/main/behaviors/oven-mode';
27
5
  import { OvenCavityOperationalStateServer } from '@matter/main/behaviors/oven-cavity-operational-state';
28
- // Matterbridge
29
6
  import { oven, powerSource, temperatureControlledCabinetHeater } from '../matterbridgeDeviceTypes.js';
30
7
  import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
31
8
  import { MatterbridgeServer } from '../matterbridgeBehaviors.js';
32
9
  import { createLevelTemperatureControlClusterServer } from './temperatureControl.js';
33
10
  export class Oven extends MatterbridgeEndpoint {
34
- /**
35
- * Creates an instance of the Oven class.
36
- *
37
- * @param {string} name - The name of the oven.
38
- * @param {string} serial - The serial number of the oven.
39
- *
40
- * @remarks
41
- * 13.9 An oven represents a device that contains one or more cabinets, and optionally a single cooktop,
42
- * that are all capable of heating food. Examples of consumer products implementing this device type
43
- * include ovens, wall ovens, convection ovens, etc.
44
- * An oven is always defined via endpoint composition.
45
- * - Use `addCabinet` to add one or more cabinets to the oven.
46
- */
47
11
  constructor(name, serial) {
48
12
  super([oven, powerSource], { uniqueStorageKey: `${name.replaceAll(' ', '')}-${serial.replaceAll(' ', '')}` }, true);
49
13
  this.createDefaultIdentifyClusterServer();
@@ -51,25 +15,6 @@ export class Oven extends MatterbridgeEndpoint {
51
15
  this.createDefaultPowerSourceWiredClusterServer();
52
16
  this.addFixedLabel('composed', 'Oven');
53
17
  }
54
- /**
55
- * Adds a Temperature Controlled Cabinet Heater to the oven.
56
- *
57
- * @param {string} name - The name of the cabinet.
58
- * @param {Semtag[]} tagList - The tagList associated with the cabinet.
59
- * @param {number} currentMode - The current mode of the cabinet. Defaults to 2 (which corresponds to 'Convection').
60
- * @param {OvenMode.ModeOption[]} supportedModes - The supported modes of the cabinet. Defaults to a set of common oven modes.
61
- * @param {number} selectedTemperatureLevel - The selected temperature level as an index of the supportedTemperatureLevels array. Defaults to 1 (which corresponds to 'Warm').
62
- * @param {string[]} supportedTemperatureLevels - The list of supported temperature levels for the cabinet. Defaults to ['Defrost', '180°', '190°', '200°', '250°', '300°'].
63
- * @param {OperationalState.OperationalStateEnum} operationalState - The initial operational state of the cabinet. Defaults to Stopped.
64
- * @param {number} [currentPhase] - Optional: the current phase of the cabinet.
65
- * @param {string[]} [phaseList] - Optional: the list of phases for the cabinet.
66
- *
67
- * @returns {MatterbridgeEndpoint} The MatterbridgeEndpoint instance representing the cabinet.
68
- *
69
- * @remarks
70
- * 13.4.1 A Temperature Controlled Cabinet Heater is a device that provides a heated space for warming food.
71
- * It is typically installed within an oven and can be used in conjunction with other heating elements.
72
- */
73
18
  addCabinet(name, tagList, currentMode = 2, supportedModes = [
74
19
  { label: 'Bake', mode: 1, modeTags: [{ value: OvenMode.ModeTag.Bake }] },
75
20
  { label: 'Convection', mode: 2, modeTags: [{ value: OvenMode.ModeTag.Convection }] },
@@ -91,19 +36,6 @@ export class Oven extends MatterbridgeEndpoint {
91
36
  this.createDefaultOvenCavityOperationalStateClusterServer(cabinet, operationalState, currentPhase, phaseList);
92
37
  return cabinet;
93
38
  }
94
- /**
95
- * Creates a default OvenMode Cluster Server.
96
- *
97
- * @param {MatterbridgeEndpoint} endpoint - The Matterbridge endpoint instance.
98
- * @param {number} currentMode - The current mode of the oven.
99
- * @param {OvenMode.ModeOption[]} supportedModes - The supported modes of the oven.
100
- *
101
- * @returns {MatterbridgeEndpoint} The current MatterbridgeEndpoint instance for chaining.
102
- *
103
- * @remarks
104
- * - supportedModes is a fixed attribute. It cannot be changed at runtime.
105
- * - currentMode persists across reboots.
106
- */
107
39
  createDefaultOvenModeClusterServer(endpoint, currentMode, supportedModes) {
108
40
  endpoint.behaviors.require(MatterbridgeOvenModeServer, {
109
41
  supportedModes,
@@ -111,20 +43,6 @@ export class Oven extends MatterbridgeEndpoint {
111
43
  });
112
44
  return endpoint;
113
45
  }
114
- /**
115
- * Creates a default Oven Cavity Operational State Cluster Server.
116
- *
117
- * @param {MatterbridgeEndpoint} endpoint - The Matterbridge endpoint instance.
118
- * @param {OperationalState.OperationalStateEnum} operationalState - The initial operational state.
119
- * @param {number} [currentPhase] - The current phase of the oven cavity.
120
- * @param {string[]} [phaseList] - The list of phases for the oven cavity.
121
- *
122
- * @returns {this} The current MatterbridgeEndpoint instance for chaining.
123
- *
124
- * @remarks
125
- * For this derived cluster, only these pre-defined strings may be used in the PhaseList attribute:
126
- * "pre-heating", "pre-heated", and "cooling down".
127
- */
128
46
  createDefaultOvenCavityOperationalStateClusterServer(endpoint, operationalState = OperationalState.OperationalStateEnum.Stopped, currentPhase, phaseList) {
129
47
  endpoint.behaviors.require(MatterbridgeOvenCavityOperationalStateServer, {
130
48
  phaseList: phaseList || null,
@@ -140,7 +58,6 @@ export class Oven extends MatterbridgeEndpoint {
140
58
  return endpoint;
141
59
  }
142
60
  }
143
- // Server for OvenMode
144
61
  export class MatterbridgeOvenModeServer extends OvenModeServer {
145
62
  initialize() {
146
63
  const device = this.endpoint.stateOf(MatterbridgeServer);
@@ -160,7 +77,6 @@ export class MatterbridgeOvenModeServer extends OvenModeServer {
160
77
  }
161
78
  }
162
79
  }
163
- // Server for OvenCavityOperationalState
164
80
  export class MatterbridgeOvenCavityOperationalStateServer extends OvenCavityOperationalStateServer {
165
81
  initialize() {
166
82
  const device = this.endpoint.stateOf(MatterbridgeServer);
@@ -187,4 +103,3 @@ export class MatterbridgeOvenCavityOperationalStateServer extends OvenCavityOper
187
103
  };
188
104
  }
189
105
  }
190
- //# sourceMappingURL=oven.js.map
@@ -1,47 +1,11 @@
1
- /**
2
- * @description This file contains the Refrigerator class.
3
- * @file src/devices/refrigerator.ts
4
- * @author Luca Liguori
5
- * @created 2025-05-25
6
- * @version 1.1.0
7
- * @license Apache-2.0
8
- *
9
- * Copyright 2025, 2026, 2027 Luca Liguori.
10
- *
11
- * Licensed under the Apache License, Version 2.0 (the "License");
12
- * you may not use this file except in compliance with the License.
13
- * You may obtain a copy of the License at
14
- *
15
- * http://www.apache.org/licenses/LICENSE-2.0
16
- *
17
- * Unless required by applicable law or agreed to in writing, software
18
- * distributed under the License is distributed on an "AS IS" BASIS,
19
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
- * See the License for the specific language governing permissions and
21
- * limitations under the License.
22
- */
23
1
  import { ModeBase } from '@matter/main/clusters/mode-base';
24
2
  import { RefrigeratorAndTemperatureControlledCabinetModeServer } from '@matter/main/behaviors/refrigerator-and-temperature-controlled-cabinet-mode';
25
3
  import { RefrigeratorAndTemperatureControlledCabinetMode } from '@matter/main/clusters/refrigerator-and-temperature-controlled-cabinet-mode';
26
- // Matterbridge
27
4
  import { oven, powerSource, temperatureControlledCabinetCooler } from '../matterbridgeDeviceTypes.js';
28
5
  import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
29
6
  import { MatterbridgeServer } from '../matterbridgeBehaviors.js';
30
7
  import { createLevelTemperatureControlClusterServer } from './temperatureControl.js';
31
8
  export class Refrigerator extends MatterbridgeEndpoint {
32
- /**
33
- * Creates an instance of the Refrigerator class.
34
- *
35
- * @param {string} name - The name of the refrigerator.
36
- * @param {string} serial - The serial number of the refrigerator.
37
- *
38
- * @remarks
39
- * 13.2 A refrigerator represents a device that contains one or more cabinets that are capable of chilling or
40
- * freezing food. Examples of consumer products that MAY make use of this device type include refrigerators,
41
- * freezers, and wine coolers.
42
- * A refrigerator is always defined via endpoint composition.
43
- * - Use `addCabinet` to add one or more cabinets to the refrigerator.
44
- */
45
9
  constructor(name, serial) {
46
10
  super([oven, powerSource], { uniqueStorageKey: `${name.replaceAll(' ', '')}-${serial.replaceAll(' ', '')}` }, true);
47
11
  this.createDefaultIdentifyClusterServer();
@@ -49,35 +13,6 @@ export class Refrigerator extends MatterbridgeEndpoint {
49
13
  this.createDefaultPowerSourceWiredClusterServer();
50
14
  this.addFixedLabel('composed', 'Refrigerator');
51
15
  }
52
- /**
53
- * Adds a Level Temperature Controlled Cabinet Cooler to the refrigerator.
54
- *
55
- * @param {string} name - The name of the cabinet.
56
- * @param {Semtag[]} tagList - The tagList associated with the cabinet.
57
- * @param {number} currentMode - The current mode of the cabinet. Defaults to 1 (which corresponds to 'Auto').
58
- * @param {RefrigeratorAndTemperatureControlledCabinetMode.ModeOption[]} supportedModes - The supported modes for the cabinet. Defaults to 'Auto', 'RapidCool', and 'RapidFreeze'.
59
- * @param {number} selectedTemperatureLevel - The selected temperature level as an index of the supportedTemperatureLevels array. Defaults to 2 (which corresponds to 'Level 3').
60
- * @param {string[]} supportedTemperatureLevels - The list of supported temperature levels for the cabinet. Defaults to ['Level 1', 'Level 2', 'Level 3', 'Level 4', 'Level 5'].
61
- * @param {number} currentTemperature - The current temperature of the cabinet in degrees Celsius. Defaults to 1000 (which corresponds to 10.00 degrees Celsius).
62
- *
63
- * @returns {MatterbridgeEndpoint} The MatterbridgeEndpoint instance representing the cabinet.
64
- *
65
- * @remarks
66
- * 13.4.1 A Temperature Controlled Cabinet Cooler is a device that provides a cooled space for chilling food.
67
- * It is typically installed within a refrigerator.
68
- *
69
- * Example usage with specific namespace tags:
70
- * ```
71
- * refrigerator.addCabinet('Refrigerator Top', [
72
- * { mfgCode: null, namespaceId: PositionTag.Top.namespaceId, tag: PositionTag.Top.tag, label: 'Refrigerator Top' },
73
- * { mfgCode: null, namespaceId: RefrigeratorTag.Refrigerator.namespaceId, tag: RefrigeratorTag.Refrigerator.tag, label: RefrigeratorTag.Refrigerator.label },
74
- * ]);
75
- * refrigerator.addCabinet('Freezer Bottom', [
76
- * { mfgCode: null, namespaceId: PositionTag.Bottom.namespaceId, tag: PositionTag.Bottom.tag, label: 'Freezer Bottom' },
77
- * { mfgCode: null, namespaceId: RefrigeratorTag.Freezer.namespaceId, tag: RefrigeratorTag.Freezer.tag, label: RefrigeratorTag.Freezer.label },
78
- * ]);
79
- * ```
80
- */
81
16
  addCabinet(name, tagList, currentMode = 1, supportedModes = [
82
17
  { label: 'Auto', mode: 1, modeTags: [{ value: RefrigeratorAndTemperatureControlledCabinetMode.ModeTag.Auto }] },
83
18
  { label: 'RapidCool', mode: 2, modeTags: [{ value: RefrigeratorAndTemperatureControlledCabinetMode.ModeTag.RapidCool }] },
@@ -91,19 +26,6 @@ export class Refrigerator extends MatterbridgeEndpoint {
91
26
  cabinet.createDefaultTemperatureMeasurementClusterServer(currentTemperature);
92
27
  return cabinet;
93
28
  }
94
- /**
95
- * Creates a default RefrigeratorAndTemperatureControlledCabinetMode Cluster Server.
96
- *
97
- * @param {MatterbridgeEndpoint} endpoint - The Matterbridge endpoint instance.
98
- * @param {number} currentMode - The current mode of the oven.
99
- * @param {RefrigeratorAndTemperatureControlledCabinetMode.ModeOption[]} supportedModes - The supported modes for the refrigerator and temperature controlled cabinet.
100
- *
101
- * @returns {MatterbridgeEndpoint} The current MatterbridgeEndpoint instance for chaining.
102
- *
103
- * @remarks
104
- * - supportedModes is a fixed attribute. It cannot be changed at runtime.
105
- * - currentMode persists across reboots.
106
- */
107
29
  createDefaultRefrigeratorAndTemperatureControlledCabinetModeClusterServer(endpoint, currentMode, supportedModes) {
108
30
  endpoint.behaviors.require(MatterbridgeRefrigeratorAndTemperatureControlledCabinetModeServer, {
109
31
  supportedModes,
@@ -112,7 +34,6 @@ export class Refrigerator extends MatterbridgeEndpoint {
112
34
  return endpoint;
113
35
  }
114
36
  }
115
- // Server for RefrigeratorAndTemperatureControlledCabinetMode
116
37
  export class MatterbridgeRefrigeratorAndTemperatureControlledCabinetModeServer extends RefrigeratorAndTemperatureControlledCabinetModeServer {
117
38
  initialize() {
118
39
  const device = this.endpoint.stateOf(MatterbridgeServer);
@@ -132,4 +53,3 @@ export class MatterbridgeRefrigeratorAndTemperatureControlledCabinetModeServer e
132
53
  }
133
54
  }
134
55
  }
135
- //# sourceMappingURL=refrigerator.js.map
@@ -1,26 +1,3 @@
1
- /**
2
- * @description This file contains the RoboticVacuumCleaner class.
3
- * @file src/devices/roboticVacuumCleaner.ts
4
- * @author Luca Liguori
5
- * @created 2025-05-01
6
- * @version 1.1.0
7
- * @license Apache-2.0
8
- *
9
- * Copyright 2025, 2026, 2027 Luca Liguori.
10
- *
11
- * Licensed under the Apache License, Version 2.0 (the "License");
12
- * you may not use this file except in compliance with the License.
13
- * You may obtain a copy of the License at
14
- *
15
- * http://www.apache.org/licenses/LICENSE-2.0
16
- *
17
- * Unless required by applicable law or agreed to in writing, software
18
- * distributed under the License is distributed on an "AS IS" BASIS,
19
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
- * See the License for the specific language governing permissions and
21
- * limitations under the License.
22
- */
23
- // Matter.js
24
1
  import { AreaNamespaceTag } from '@matter/main';
25
2
  import { RvcRunModeServer } from '@matter/main/behaviors/rvc-run-mode';
26
3
  import { RvcOperationalStateServer } from '@matter/main/behaviors/rvc-operational-state';
@@ -32,30 +9,10 @@ import { RvcOperationalState } from '@matter/main/clusters/rvc-operational-state
32
9
  import { ServiceArea } from '@matter/main/clusters/service-area';
33
10
  import { ModeBase } from '@matter/main/clusters/mode-base';
34
11
  import { OperationalState } from '@matter/main/clusters/operational-state';
35
- // Matterbridge
36
12
  import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
37
13
  import { powerSource, roboticVacuumCleaner } from '../matterbridgeDeviceTypes.js';
38
14
  import { MatterbridgeServer, MatterbridgeServiceAreaServer } from '../matterbridgeBehaviors.js';
39
15
  export class RoboticVacuumCleaner extends MatterbridgeEndpoint {
40
- /**
41
- * Creates an instance of the RoboticVacuumCleaner class.
42
- *
43
- * @param {string} name - The name of the robotic vacuum cleaner.
44
- * @param {string} serial - The serial number of the robotic vacuum cleaner.
45
- * @param {'server' | 'matter' | undefined} [mode] - The mode of the robotic vacuum cleaner. Defaults to undefined. Use 'server' or 'matter' if you want Apple Home compatibility.
46
- * @param {number} [currentRunMode] - The current run mode of the robotic vacuum cleaner. Defaults to 1 (Idle).
47
- * @param {RvcRunMode.ModeOption[]} [supportedRunModes] - The supported run modes for the robotic vacuum cleaner. Defaults to a predefined set of modes.
48
- * @param {number} [currentCleanMode] - The current clean mode of the robotic vacuum cleaner. Defaults to 1 (Vacuum).
49
- * @param {RvcCleanMode.ModeOption[]} [supportedCleanModes] - The supported clean modes for the robotic vacuum cleaner. Defaults to a predefined set of modes.
50
- * @param {number | null} [currentPhase] - The current phase of the robotic vacuum cleaner. Defaults to null.
51
- * @param {string[] | null} [phaseList] - The list of phases for the robotic vacuum cleaner. Defaults to null.
52
- * @param {RvcOperationalState.OperationalState} [operationalState] - The current operational state of the robotic vacuum cleaner. Defaults to Docked.
53
- * @param {RvcOperationalState.OperationalStateStruct[]} [operationalStateList] - The list of operational states for the robotic vacuum cleaner. Defaults to a predefined set of states.
54
- * @param {ServiceArea.Area[]} [supportedAreas] - The supported areas for the robotic vacuum cleaner. Defaults to a predefined set of areas.
55
- * @param {number[]} [selectedAreas] - The selected areas for the robotic vacuum cleaner. Defaults to an empty array (all areas allowed).
56
- * @param {number} [currentArea] - The current area of the robotic vacuum cleaner. Defaults to 1 (Living).
57
- * @param {ServiceArea.Map[]} [supportedMaps] - The supported maps for the robotic vacuum cleaner. Defaults to empty list.
58
- */
59
16
  constructor(name, serial, mode = undefined, currentRunMode, supportedRunModes, currentCleanMode, supportedCleanModes, currentPhase = null, phaseList = null, operationalState, operationalStateList, supportedAreas, selectedAreas, currentArea, supportedMaps) {
60
17
  super([roboticVacuumCleaner, powerSource], { uniqueStorageKey: `${name.replaceAll(' ', '')}-${serial.replaceAll(' ', '')}`, mode }, true);
61
18
  this.createDefaultIdentifyClusterServer()
@@ -66,17 +23,6 @@ export class RoboticVacuumCleaner extends MatterbridgeEndpoint {
66
23
  .createDefaultRvcOperationalStateClusterServer(phaseList, currentPhase, operationalStateList, operationalState)
67
24
  .createDefaultServiceAreaClusterServer(supportedAreas, selectedAreas, currentArea, supportedMaps);
68
25
  }
69
- /**
70
- * Creates a default RvcRunMode Cluster Server.
71
- *
72
- * @param {number} [currentMode] - The current mode of the RvcRunMode cluster. Defaults to 1 (Idle).
73
- * @param {RvcRunMode.ModeOption[]} [supportedModes] - The supported modes for the RvcRunMode cluster. Defaults to a predefined set of modes.
74
- *
75
- * @returns {this} The current MatterbridgeEndpoint instance for chaining.
76
- *
77
- * @remarks
78
- * - supportedModes is a fixed attribute that defines the run modes available for the robotic vacuum cleaner.
79
- */
80
26
  createDefaultRvcRunModeClusterServer(currentMode, supportedModes) {
81
27
  this.behaviors.require(MatterbridgeRvcRunModeServer, {
82
28
  supportedModes: supportedModes ?? [
@@ -89,17 +35,6 @@ export class RoboticVacuumCleaner extends MatterbridgeEndpoint {
89
35
  });
90
36
  return this;
91
37
  }
92
- /**
93
- * Creates a default RvcCleanMode Cluster Server.
94
- *
95
- * @param {number} [currentMode] - The current mode of the RvcCleanMode cluster. Defaults to 1 (Vacuum).
96
- * @param {RvcCleanMode.ModeOption[]} [supportedModes] - The supported modes for the RvcCleanMode cluster. Defaults to a predefined set of modes.
97
- *
98
- * @returns {this} The current MatterbridgeEndpoint instance for chaining.
99
- *
100
- * @remarks
101
- * - supportedModes is a fixed attribute that defines the clean modes available for the robotic vacuum cleaner.
102
- */
103
38
  createDefaultRvcCleanModeClusterServer(currentMode, supportedModes) {
104
39
  this.behaviors.require(MatterbridgeRvcCleanModeServer, {
105
40
  supportedModes: supportedModes ?? [
@@ -111,15 +46,6 @@ export class RoboticVacuumCleaner extends MatterbridgeEndpoint {
111
46
  });
112
47
  return this;
113
48
  }
114
- /**
115
- * Creates a default ServiceArea Cluster Server.
116
- *
117
- * @param {ServiceArea.Area[]} [supportedAreas] - The supported areas for the ServiceArea cluster. Defaults to a predefined set of areas.
118
- * @param {number[]} [selectedAreas] - The selected areas for the ServiceArea cluster. Defaults to an empty array (all areas allowed).
119
- * @param {number} [currentArea] - The current areaId (not the index in the array!) of the ServiceArea cluster. Defaults to 1 (Living).
120
- * @param {ServiceArea.Map[]} [supportedMaps] - The supported maps for the robotic vacuum cleaner. Defaults empty list.
121
- * @returns {this} The current MatterbridgeEndpoint instance for chaining.
122
- */
123
49
  createDefaultServiceAreaClusterServer(supportedAreas, selectedAreas, currentArea, supportedMaps) {
124
50
  this.behaviors.require(MatterbridgeServiceAreaServer.with(ServiceArea.Feature.Maps), {
125
51
  supportedAreas: supportedAreas ?? [
@@ -146,21 +72,11 @@ export class RoboticVacuumCleaner extends MatterbridgeEndpoint {
146
72
  ],
147
73
  selectedAreas: selectedAreas ?? [],
148
74
  currentArea: currentArea ?? 1,
149
- supportedMaps: supportedMaps ?? [], // Indicates that the device is currently unable to provide this information
75
+ supportedMaps: supportedMaps ?? [],
150
76
  estimatedEndTime: null,
151
77
  });
152
78
  return this;
153
79
  }
154
- /**
155
- * Creates a default RvcOperationalState Cluster Server.
156
- *
157
- * @param {string[] | null} [phaseList] - The list of phases for the RvcOperationalState cluster. Defaults to null.
158
- * @param {number | null} [currentPhase] - The current phase (the index of the phaseList) of the RvcOperationalState cluster. Defaults to null.
159
- * @param {RvcOperationalState.OperationalStateStruct[]} [operationalStateList] - The list of operational states for the RvcOperationalState cluster. Defaults to a predefined set of states.
160
- * @param {RvcOperationalState.OperationalState} [operationalState] - The current operationalStateId of the RvcOperationalState cluster. Defaults to Docked.
161
- * @param {RvcOperationalState.ErrorStateStruct} [operationalError] - The current operational error of the RvcOperationalState cluster. Defaults to NoError.
162
- * @returns {this} The current MatterbridgeEndpoint instance for chaining.
163
- */
164
80
  createDefaultRvcOperationalStateClusterServer(phaseList = null, currentPhase = null, operationalStateList, operationalState, operationalError) {
165
81
  this.behaviors.require(MatterbridgeRvcOperationalStateServer, {
166
82
  phaseList,
@@ -170,9 +86,9 @@ export class RoboticVacuumCleaner extends MatterbridgeEndpoint {
170
86
  { operationalStateId: RvcOperationalState.OperationalState.Running, operationalStateLabel: 'Running' },
171
87
  { operationalStateId: RvcOperationalState.OperationalState.Paused, operationalStateLabel: 'Paused' },
172
88
  { operationalStateId: RvcOperationalState.OperationalState.Error, operationalStateLabel: 'Error' },
173
- { operationalStateId: RvcOperationalState.OperationalState.SeekingCharger, operationalStateLabel: 'SeekingCharger' }, // Y RVC Pause Compatibility N RVC Resume Compatibility
174
- { operationalStateId: RvcOperationalState.OperationalState.Charging, operationalStateLabel: 'Charging' }, // N RVC Pause Compatibility Y RVC Resume Compatibility
175
- { operationalStateId: RvcOperationalState.OperationalState.Docked, operationalStateLabel: 'Docked' }, // N RVC Pause Compatibility Y RVC Resume Compatibility
89
+ { operationalStateId: RvcOperationalState.OperationalState.SeekingCharger, operationalStateLabel: 'SeekingCharger' },
90
+ { operationalStateId: RvcOperationalState.OperationalState.Charging, operationalStateLabel: 'Charging' },
91
+ { operationalStateId: RvcOperationalState.OperationalState.Docked, operationalStateLabel: 'Docked' },
176
92
  ],
177
93
  operationalState: operationalState ?? RvcOperationalState.OperationalState.Docked,
178
94
  operationalError: operationalError ?? { errorStateId: RvcOperationalState.ErrorState.NoError, errorStateLabel: 'No Error', errorStateDetails: 'Fully operational' },
@@ -227,7 +143,7 @@ export class MatterbridgeRvcOperationalStateServer extends RvcOperationalStateSe
227
143
  device.log.info(`Pause (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
228
144
  device.commandHandler.executeHandler('pause', { request: {}, cluster: RvcOperationalStateServer.id, attributes: this.state, endpoint: this.endpoint });
229
145
  device.log.debug('MatterbridgeRvcOperationalStateServer: pause called setting operational state to Paused and currentMode to Idle');
230
- this.agent.get(MatterbridgeRvcRunModeServer).state.currentMode = 1; // RvcRunMode.ModeTag.Idle
146
+ this.agent.get(MatterbridgeRvcRunModeServer).state.currentMode = 1;
231
147
  this.state.operationalState = RvcOperationalState.OperationalState.Paused;
232
148
  this.state.operationalError = { errorStateId: RvcOperationalState.ErrorState.NoError, errorStateLabel: 'No Error', errorStateDetails: 'Fully operational' };
233
149
  return {
@@ -239,7 +155,7 @@ export class MatterbridgeRvcOperationalStateServer extends RvcOperationalStateSe
239
155
  device.log.info(`Resume (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
240
156
  device.commandHandler.executeHandler('resume', { request: {}, cluster: RvcOperationalStateServer.id, attributes: this.state, endpoint: this.endpoint });
241
157
  device.log.debug('MatterbridgeRvcOperationalStateServer: resume called setting operational state to Running and currentMode to Cleaning');
242
- this.agent.get(MatterbridgeRvcRunModeServer).state.currentMode = 2; // RvcRunMode.ModeTag.Cleaning
158
+ this.agent.get(MatterbridgeRvcRunModeServer).state.currentMode = 2;
243
159
  this.state.operationalState = RvcOperationalState.OperationalState.Running;
244
160
  this.state.operationalError = { errorStateId: RvcOperationalState.ErrorState.NoError, errorStateLabel: 'No Error', errorStateDetails: 'Fully operational' };
245
161
  return {
@@ -247,12 +163,11 @@ export class MatterbridgeRvcOperationalStateServer extends RvcOperationalStateSe
247
163
  };
248
164
  }
249
165
  goHome() {
250
- // const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
251
166
  const device = this.endpoint.stateOf(MatterbridgeServer);
252
167
  device.log.info(`GoHome (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
253
168
  device.commandHandler.executeHandler('goHome', { request: {}, cluster: RvcOperationalStateServer.id, attributes: this.state, endpoint: this.endpoint });
254
169
  device.log.debug('MatterbridgeRvcOperationalStateServer: goHome called setting operational state to Docked and currentMode to Idle');
255
- this.agent.get(MatterbridgeRvcRunModeServer).state.currentMode = 1; // RvcRunMode.ModeTag.Idle
170
+ this.agent.get(MatterbridgeRvcRunModeServer).state.currentMode = 1;
256
171
  this.state.operationalState = RvcOperationalState.OperationalState.Docked;
257
172
  this.state.operationalError = { errorStateId: RvcOperationalState.ErrorState.NoError, errorStateLabel: 'No Error', errorStateDetails: 'Fully operational' };
258
173
  return {
@@ -260,4 +175,3 @@ export class MatterbridgeRvcOperationalStateServer extends RvcOperationalStateSe
260
175
  };
261
176
  }
262
177
  }
263
- //# sourceMappingURL=roboticVacuumCleaner.js.map
@@ -1,45 +1,8 @@
1
- /**
2
- * @description This file contains the SolarPower class.
3
- * @file src/devices/solarPower.ts
4
- * @author Luca Liguori
5
- * @contributor Ludovic BOUÉ
6
- * @created 2025-06-14
7
- * @version 1.0.0
8
- * @license Apache-2.0
9
- *
10
- * Copyright 2025, 2026, 2027 Luca Liguori.
11
- *
12
- * Licensed under the Apache License, Version 2.0 (the "License");
13
- * you may not use this file except in compliance with the License.
14
- * You may obtain a copy of the License at
15
- *
16
- * http://www.apache.org/licenses/LICENSE-2.0
17
- *
18
- * Unless required by applicable law or agreed to in writing, software
19
- * distributed under the License is distributed on an "AS IS" BASIS,
20
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
- * See the License for the specific language governing permissions and
22
- * limitations under the License.
23
- */
24
- // @matter
25
1
  import { PowerSourceTag } from '@matter/main';
26
2
  import { DeviceEnergyManagement } from '@matter/main/clusters/device-energy-management';
27
- // Matterbridge
28
3
  import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
29
4
  import { deviceEnergyManagement, electricalSensor, solarPower, powerSource } from '../matterbridgeDeviceTypes.js';
30
5
  export class SolarPower extends MatterbridgeEndpoint {
31
- /**
32
- * Creates an instance of the SolarPower class.
33
- *
34
- * @param {string} name - The name of the SolarPower.
35
- * @param {string} serial - The serial number of the SolarPower.
36
- * @param {number} voltage - The voltage value in millivolts.
37
- * @param {number} current - The current value in milliamperes.
38
- * @param {number} power - The power value in milliwatts.
39
- * @param {number} energyExported - The total production value in mW/h.
40
- * @param {number} [absMinPower] - Indicate the minimum electrical power in mw that the ESA can consume when switched on. Defaults to `0` if not provided.
41
- * @param {number} [absMaxPower] - Indicate the maximum electrical power in mw that the ESA can consume when switched on. Defaults to `0` if not provided.
42
- */
43
6
  constructor(name, serial, voltage = null, current = null, power = null, energyExported = null, absMinPower = 0, absMaxPower = 0) {
44
7
  super([solarPower, powerSource, electricalSensor, deviceEnergyManagement], {
45
8
  tagList: [{ mfgCode: null, namespaceId: PowerSourceTag.Solar.namespaceId, tag: PowerSourceTag.Solar.tag, label: null }],
@@ -56,4 +19,3 @@ export class SolarPower extends MatterbridgeEndpoint {
56
19
  .addRequiredClusterServers();
57
20
  }
58
21
  }
59
- //# sourceMappingURL=solarPower.js.map