matterbridge 3.2.4-dev-20250830-5c48452 → 3.2.4

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 (266) hide show
  1. package/dist/cli.d.ts +26 -0
  2. package/dist/cli.d.ts.map +1 -0
  3. package/dist/cli.js +91 -2
  4. package/dist/cli.js.map +1 -0
  5. package/dist/cliEmitter.d.ts +34 -0
  6. package/dist/cliEmitter.d.ts.map +1 -0
  7. package/dist/cliEmitter.js +30 -0
  8. package/dist/cliEmitter.js.map +1 -0
  9. package/dist/clusters/export.d.ts +2 -0
  10. package/dist/clusters/export.d.ts.map +1 -0
  11. package/dist/clusters/export.js +2 -0
  12. package/dist/clusters/export.js.map +1 -0
  13. package/dist/defaultConfigSchema.d.ts +28 -0
  14. package/dist/defaultConfigSchema.d.ts.map +1 -0
  15. package/dist/defaultConfigSchema.js +24 -0
  16. package/dist/defaultConfigSchema.js.map +1 -0
  17. package/dist/deviceManager.d.ts +112 -0
  18. package/dist/deviceManager.d.ts.map +1 -0
  19. package/dist/deviceManager.js +94 -1
  20. package/dist/deviceManager.js.map +1 -0
  21. package/dist/devices/batteryStorage.d.ts +48 -0
  22. package/dist/devices/batteryStorage.d.ts.map +1 -0
  23. package/dist/devices/batteryStorage.js +48 -1
  24. package/dist/devices/batteryStorage.js.map +1 -0
  25. package/dist/devices/cooktop.d.ts +60 -0
  26. package/dist/devices/cooktop.d.ts.map +1 -0
  27. package/dist/devices/cooktop.js +55 -0
  28. package/dist/devices/cooktop.js.map +1 -0
  29. package/dist/devices/dishwasher.d.ts +71 -0
  30. package/dist/devices/dishwasher.d.ts.map +1 -0
  31. package/dist/devices/dishwasher.js +57 -0
  32. package/dist/devices/dishwasher.js.map +1 -0
  33. package/dist/devices/evse.d.ts +75 -0
  34. package/dist/devices/evse.d.ts.map +1 -0
  35. package/dist/devices/evse.js +74 -10
  36. package/dist/devices/evse.js.map +1 -0
  37. package/dist/devices/export.d.ts +15 -0
  38. package/dist/devices/export.d.ts.map +1 -0
  39. package/dist/devices/export.js +4 -0
  40. package/dist/devices/export.js.map +1 -0
  41. package/dist/devices/extractorHood.d.ts +46 -0
  42. package/dist/devices/extractorHood.d.ts.map +1 -0
  43. package/dist/devices/extractorHood.js +42 -0
  44. package/dist/devices/extractorHood.js.map +1 -0
  45. package/dist/devices/heatPump.d.ts +47 -0
  46. package/dist/devices/heatPump.d.ts.map +1 -0
  47. package/dist/devices/heatPump.js +50 -2
  48. package/dist/devices/heatPump.js.map +1 -0
  49. package/dist/devices/laundryDryer.d.ts +67 -0
  50. package/dist/devices/laundryDryer.d.ts.map +1 -0
  51. package/dist/devices/laundryDryer.js +62 -3
  52. package/dist/devices/laundryDryer.js.map +1 -0
  53. package/dist/devices/laundryWasher.d.ts +81 -0
  54. package/dist/devices/laundryWasher.d.ts.map +1 -0
  55. package/dist/devices/laundryWasher.js +70 -4
  56. package/dist/devices/laundryWasher.js.map +1 -0
  57. package/dist/devices/microwaveOven.d.ts +168 -0
  58. package/dist/devices/microwaveOven.d.ts.map +1 -0
  59. package/dist/devices/microwaveOven.js +88 -5
  60. package/dist/devices/microwaveOven.js.map +1 -0
  61. package/dist/devices/oven.d.ts +105 -0
  62. package/dist/devices/oven.d.ts.map +1 -0
  63. package/dist/devices/oven.js +85 -0
  64. package/dist/devices/oven.js.map +1 -0
  65. package/dist/devices/refrigerator.d.ts +93 -0
  66. package/dist/devices/refrigerator.d.ts.map +1 -0
  67. package/dist/devices/refrigerator.js +80 -0
  68. package/dist/devices/refrigerator.js.map +1 -0
  69. package/dist/devices/roboticVacuumCleaner.d.ts +112 -0
  70. package/dist/devices/roboticVacuumCleaner.d.ts.map +1 -0
  71. package/dist/devices/roboticVacuumCleaner.js +93 -7
  72. package/dist/devices/roboticVacuumCleaner.js.map +1 -0
  73. package/dist/devices/solarPower.d.ts +40 -0
  74. package/dist/devices/solarPower.d.ts.map +1 -0
  75. package/dist/devices/solarPower.js +38 -0
  76. package/dist/devices/solarPower.js.map +1 -0
  77. package/dist/devices/temperatureControl.d.ts +166 -0
  78. package/dist/devices/temperatureControl.d.ts.map +1 -0
  79. package/dist/devices/temperatureControl.js +25 -3
  80. package/dist/devices/temperatureControl.js.map +1 -0
  81. package/dist/devices/waterHeater.d.ts +111 -0
  82. package/dist/devices/waterHeater.d.ts.map +1 -0
  83. package/dist/devices/waterHeater.js +82 -2
  84. package/dist/devices/waterHeater.js.map +1 -0
  85. package/dist/dgram/coap.d.ts +205 -0
  86. package/dist/dgram/coap.d.ts.map +1 -0
  87. package/dist/dgram/coap.js +126 -13
  88. package/dist/dgram/coap.js.map +1 -0
  89. package/dist/dgram/dgram.d.ts +140 -0
  90. package/dist/dgram/dgram.d.ts.map +1 -0
  91. package/dist/dgram/dgram.js +113 -2
  92. package/dist/dgram/dgram.js.map +1 -0
  93. package/dist/dgram/mb_coap.d.ts +24 -0
  94. package/dist/dgram/mb_coap.d.ts.map +1 -0
  95. package/dist/dgram/mb_coap.js +41 -3
  96. package/dist/dgram/mb_coap.js.map +1 -0
  97. package/dist/dgram/mb_mdns.d.ts +24 -0
  98. package/dist/dgram/mb_mdns.d.ts.map +1 -0
  99. package/dist/dgram/mb_mdns.js +51 -13
  100. package/dist/dgram/mb_mdns.js.map +1 -0
  101. package/dist/dgram/mdns.d.ts +288 -0
  102. package/dist/dgram/mdns.d.ts.map +1 -0
  103. package/dist/dgram/mdns.js +298 -137
  104. package/dist/dgram/mdns.js.map +1 -0
  105. package/dist/dgram/multicast.d.ts +65 -0
  106. package/dist/dgram/multicast.d.ts.map +1 -0
  107. package/dist/dgram/multicast.js +60 -1
  108. package/dist/dgram/multicast.js.map +1 -0
  109. package/dist/dgram/unicast.d.ts +56 -0
  110. package/dist/dgram/unicast.d.ts.map +1 -0
  111. package/dist/dgram/unicast.js +54 -0
  112. package/dist/dgram/unicast.js.map +1 -0
  113. package/dist/frontend.d.ts +313 -0
  114. package/dist/frontend.d.ts.map +1 -0
  115. package/dist/frontend.js +451 -24
  116. package/dist/frontend.js.map +1 -0
  117. package/dist/globalMatterbridge.d.ts +59 -0
  118. package/dist/globalMatterbridge.d.ts.map +1 -0
  119. package/dist/globalMatterbridge.js +47 -0
  120. package/dist/globalMatterbridge.js.map +1 -0
  121. package/dist/helpers.d.ts +48 -0
  122. package/dist/helpers.d.ts.map +1 -0
  123. package/dist/helpers.js +53 -0
  124. package/dist/helpers.js.map +1 -0
  125. package/dist/index.d.ts +33 -0
  126. package/dist/index.d.ts.map +1 -0
  127. package/dist/index.js +30 -1
  128. package/dist/index.js.map +1 -0
  129. package/dist/logger/export.d.ts +2 -0
  130. package/dist/logger/export.d.ts.map +1 -0
  131. package/dist/logger/export.js +1 -0
  132. package/dist/logger/export.js.map +1 -0
  133. package/dist/matter/behaviors.d.ts +2 -0
  134. package/dist/matter/behaviors.d.ts.map +1 -0
  135. package/dist/matter/behaviors.js +2 -0
  136. package/dist/matter/behaviors.js.map +1 -0
  137. package/dist/matter/clusters.d.ts +2 -0
  138. package/dist/matter/clusters.d.ts.map +1 -0
  139. package/dist/matter/clusters.js +2 -0
  140. package/dist/matter/clusters.js.map +1 -0
  141. package/dist/matter/devices.d.ts +2 -0
  142. package/dist/matter/devices.d.ts.map +1 -0
  143. package/dist/matter/devices.js +2 -0
  144. package/dist/matter/devices.js.map +1 -0
  145. package/dist/matter/endpoints.d.ts +2 -0
  146. package/dist/matter/endpoints.d.ts.map +1 -0
  147. package/dist/matter/endpoints.js +2 -0
  148. package/dist/matter/endpoints.js.map +1 -0
  149. package/dist/matter/export.d.ts +5 -0
  150. package/dist/matter/export.d.ts.map +1 -0
  151. package/dist/matter/export.js +3 -0
  152. package/dist/matter/export.js.map +1 -0
  153. package/dist/matter/types.d.ts +3 -0
  154. package/dist/matter/types.d.ts.map +1 -0
  155. package/dist/matter/types.js +3 -0
  156. package/dist/matter/types.js.map +1 -0
  157. package/dist/matterbridge.d.ts +462 -0
  158. package/dist/matterbridge.d.ts.map +1 -0
  159. package/dist/matterbridge.js +789 -50
  160. package/dist/matterbridge.js.map +1 -0
  161. package/dist/matterbridgeAccessoryPlatform.d.ts +42 -0
  162. package/dist/matterbridgeAccessoryPlatform.d.ts.map +1 -0
  163. package/dist/matterbridgeAccessoryPlatform.js +36 -0
  164. package/dist/matterbridgeAccessoryPlatform.js.map +1 -0
  165. package/dist/matterbridgeBehaviors.d.ts +1351 -0
  166. package/dist/matterbridgeBehaviors.d.ts.map +1 -0
  167. package/dist/matterbridgeBehaviors.js +65 -5
  168. package/dist/matterbridgeBehaviors.js.map +1 -0
  169. package/dist/matterbridgeDeviceTypes.d.ts +709 -0
  170. package/dist/matterbridgeDeviceTypes.d.ts.map +1 -0
  171. package/dist/matterbridgeDeviceTypes.js +579 -15
  172. package/dist/matterbridgeDeviceTypes.js.map +1 -0
  173. package/dist/matterbridgeDynamicPlatform.d.ts +42 -0
  174. package/dist/matterbridgeDynamicPlatform.d.ts.map +1 -0
  175. package/dist/matterbridgeDynamicPlatform.js +36 -0
  176. package/dist/matterbridgeDynamicPlatform.js.map +1 -0
  177. package/dist/matterbridgeEndpoint.d.ts +1356 -0
  178. package/dist/matterbridgeEndpoint.d.ts.map +1 -0
  179. package/dist/matterbridgeEndpoint.js +1220 -54
  180. package/dist/matterbridgeEndpoint.js.map +1 -0
  181. package/dist/matterbridgeEndpointHelpers.d.ts +407 -0
  182. package/dist/matterbridgeEndpointHelpers.d.ts.map +1 -0
  183. package/dist/matterbridgeEndpointHelpers.js +345 -12
  184. package/dist/matterbridgeEndpointHelpers.js.map +1 -0
  185. package/dist/matterbridgePlatform.d.ts +331 -0
  186. package/dist/matterbridgePlatform.d.ts.map +1 -0
  187. package/dist/matterbridgePlatform.js +256 -0
  188. package/dist/matterbridgePlatform.js.map +1 -0
  189. package/dist/matterbridgeTypes.d.ts +198 -0
  190. package/dist/matterbridgeTypes.d.ts.map +1 -0
  191. package/dist/matterbridgeTypes.js +25 -0
  192. package/dist/matterbridgeTypes.js.map +1 -0
  193. package/dist/pluginManager.d.ts +270 -0
  194. package/dist/pluginManager.d.ts.map +1 -0
  195. package/dist/pluginManager.js +249 -3
  196. package/dist/pluginManager.js.map +1 -0
  197. package/dist/shelly.d.ts +174 -0
  198. package/dist/shelly.d.ts.map +1 -0
  199. package/dist/shelly.js +168 -7
  200. package/dist/shelly.js.map +1 -0
  201. package/dist/storage/export.d.ts +2 -0
  202. package/dist/storage/export.d.ts.map +1 -0
  203. package/dist/storage/export.js +1 -0
  204. package/dist/storage/export.js.map +1 -0
  205. package/dist/update.d.ts +75 -0
  206. package/dist/update.d.ts.map +1 -0
  207. package/dist/update.js +69 -0
  208. package/dist/update.js.map +1 -0
  209. package/dist/utils/colorUtils.d.ts +99 -0
  210. package/dist/utils/colorUtils.d.ts.map +1 -0
  211. package/dist/utils/colorUtils.js +97 -2
  212. package/dist/utils/colorUtils.js.map +1 -0
  213. package/dist/utils/commandLine.d.ts +59 -0
  214. package/dist/utils/commandLine.d.ts.map +1 -0
  215. package/dist/utils/commandLine.js +54 -0
  216. package/dist/utils/commandLine.js.map +1 -0
  217. package/dist/utils/copyDirectory.d.ts +33 -0
  218. package/dist/utils/copyDirectory.d.ts.map +1 -0
  219. package/dist/utils/copyDirectory.js +38 -1
  220. package/dist/utils/copyDirectory.js.map +1 -0
  221. package/dist/utils/createDirectory.d.ts +34 -0
  222. package/dist/utils/createDirectory.d.ts.map +1 -0
  223. package/dist/utils/createDirectory.js +33 -0
  224. package/dist/utils/createDirectory.js.map +1 -0
  225. package/dist/utils/createZip.d.ts +39 -0
  226. package/dist/utils/createZip.d.ts.map +1 -0
  227. package/dist/utils/createZip.js +47 -2
  228. package/dist/utils/createZip.js.map +1 -0
  229. package/dist/utils/deepCopy.d.ts +32 -0
  230. package/dist/utils/deepCopy.d.ts.map +1 -0
  231. package/dist/utils/deepCopy.js +39 -0
  232. package/dist/utils/deepCopy.js.map +1 -0
  233. package/dist/utils/deepEqual.d.ts +54 -0
  234. package/dist/utils/deepEqual.d.ts.map +1 -0
  235. package/dist/utils/deepEqual.js +72 -1
  236. package/dist/utils/deepEqual.js.map +1 -0
  237. package/dist/utils/error.d.ts +44 -0
  238. package/dist/utils/error.d.ts.map +1 -0
  239. package/dist/utils/error.js +41 -0
  240. package/dist/utils/error.js.map +1 -0
  241. package/dist/utils/export.d.ts +12 -0
  242. package/dist/utils/export.d.ts.map +1 -0
  243. package/dist/utils/export.js +1 -0
  244. package/dist/utils/export.js.map +1 -0
  245. package/dist/utils/hex.d.ts +89 -0
  246. package/dist/utils/hex.d.ts.map +1 -0
  247. package/dist/utils/hex.js +124 -0
  248. package/dist/utils/hex.js.map +1 -0
  249. package/dist/utils/isvalid.d.ts +103 -0
  250. package/dist/utils/isvalid.d.ts.map +1 -0
  251. package/dist/utils/isvalid.js +101 -0
  252. package/dist/utils/isvalid.js.map +1 -0
  253. package/dist/utils/network.d.ts +84 -0
  254. package/dist/utils/network.d.ts.map +1 -0
  255. package/dist/utils/network.js +91 -5
  256. package/dist/utils/network.js.map +1 -0
  257. package/dist/utils/spawn.d.ts +33 -0
  258. package/dist/utils/spawn.d.ts.map +1 -0
  259. package/dist/utils/spawn.js +40 -0
  260. package/dist/utils/spawn.js.map +1 -0
  261. package/dist/utils/wait.d.ts +54 -0
  262. package/dist/utils/wait.d.ts.map +1 -0
  263. package/dist/utils/wait.js +60 -8
  264. package/dist/utils/wait.js.map +1 -0
  265. package/npm-shrinkwrap.json +2 -2
  266. package/package.json +2 -1
@@ -1,11 +1,47 @@
1
+ /**
2
+ * @description This file contains the Refrigerator class.
3
+ * @file src/devices/refrigerator.ts
4
+ * @author Luca Liguori
5
+ * @created 2025-05-25
6
+ * @version 1.1.0
7
+ * @license Apache-2.0
8
+ *
9
+ * Copyright 2025, 2026, 2027 Luca Liguori.
10
+ *
11
+ * Licensed under the Apache License, Version 2.0 (the "License");
12
+ * you may not use this file except in compliance with the License.
13
+ * You may obtain a copy of the License at
14
+ *
15
+ * http://www.apache.org/licenses/LICENSE-2.0
16
+ *
17
+ * Unless required by applicable law or agreed to in writing, software
18
+ * distributed under the License is distributed on an "AS IS" BASIS,
19
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
+ * See the License for the specific language governing permissions and
21
+ * limitations under the License.
22
+ */
1
23
  import { ModeBase } from '@matter/main/clusters/mode-base';
2
24
  import { RefrigeratorAndTemperatureControlledCabinetModeServer } from '@matter/main/behaviors/refrigerator-and-temperature-controlled-cabinet-mode';
3
25
  import { RefrigeratorAndTemperatureControlledCabinetMode } from '@matter/main/clusters/refrigerator-and-temperature-controlled-cabinet-mode';
26
+ // Matterbridge
4
27
  import { oven, powerSource, temperatureControlledCabinetCooler } from '../matterbridgeDeviceTypes.js';
5
28
  import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
6
29
  import { MatterbridgeServer } from '../matterbridgeBehaviors.js';
7
30
  import { createLevelTemperatureControlClusterServer } from './temperatureControl.js';
8
31
  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
+ */
9
45
  constructor(name, serial) {
10
46
  super([oven, powerSource], { uniqueStorageKey: `${name.replaceAll(' ', '')}-${serial.replaceAll(' ', '')}` }, true);
11
47
  this.createDefaultIdentifyClusterServer();
@@ -13,6 +49,35 @@ export class Refrigerator extends MatterbridgeEndpoint {
13
49
  this.createDefaultPowerSourceWiredClusterServer();
14
50
  this.addFixedLabel('composed', 'Refrigerator');
15
51
  }
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
+ */
16
81
  addCabinet(name, tagList, currentMode = 1, supportedModes = [
17
82
  { label: 'Auto', mode: 1, modeTags: [{ value: RefrigeratorAndTemperatureControlledCabinetMode.ModeTag.Auto }] },
18
83
  { label: 'RapidCool', mode: 2, modeTags: [{ value: RefrigeratorAndTemperatureControlledCabinetMode.ModeTag.RapidCool }] },
@@ -26,6 +91,19 @@ export class Refrigerator extends MatterbridgeEndpoint {
26
91
  cabinet.createDefaultTemperatureMeasurementClusterServer(currentTemperature);
27
92
  return cabinet;
28
93
  }
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
+ */
29
107
  createDefaultRefrigeratorAndTemperatureControlledCabinetModeClusterServer(endpoint, currentMode, supportedModes) {
30
108
  endpoint.behaviors.require(MatterbridgeRefrigeratorAndTemperatureControlledCabinetModeServer, {
31
109
  supportedModes,
@@ -34,6 +112,7 @@ export class Refrigerator extends MatterbridgeEndpoint {
34
112
  return endpoint;
35
113
  }
36
114
  }
115
+ // Server for RefrigeratorAndTemperatureControlledCabinetMode
37
116
  export class MatterbridgeRefrigeratorAndTemperatureControlledCabinetModeServer extends RefrigeratorAndTemperatureControlledCabinetModeServer {
38
117
  initialize() {
39
118
  const device = this.endpoint.stateOf(MatterbridgeServer);
@@ -53,3 +132,4 @@ export class MatterbridgeRefrigeratorAndTemperatureControlledCabinetModeServer e
53
132
  }
54
133
  }
55
134
  }
135
+ //# sourceMappingURL=refrigerator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refrigerator.js","sourceRoot":"","sources":["../../src/devices/refrigerator.ts"],"names":[],"mappings":"AAAA;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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/main';
24
+ import { RvcRunModeServer } from '@matter/main/behaviors/rvc-run-mode';
25
+ import { RvcOperationalStateServer } from '@matter/main/behaviors/rvc-operational-state';
26
+ import { RvcCleanModeServer } from '@matter/main/behaviors/rvc-clean-mode';
27
+ import { RvcRunMode } from '@matter/main/clusters/rvc-run-mode';
28
+ import { RvcCleanMode } from '@matter/main/clusters/rvc-clean-mode';
29
+ import { RvcOperationalState } from '@matter/main/clusters/rvc-operational-state';
30
+ import { ServiceArea } from '@matter/main/clusters/service-area';
31
+ import { ModeBase } from '@matter/main/clusters/mode-base';
32
+ import { OperationalState } from '@matter/main/clusters/operational-state';
33
+ import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
34
+ export declare class RoboticVacuumCleaner extends MatterbridgeEndpoint {
35
+ /**
36
+ * Creates an instance of the RoboticVacuumCleaner class.
37
+ *
38
+ * @param {string} name - The name of the robotic vacuum cleaner.
39
+ * @param {string} serial - The serial number of the robotic vacuum cleaner.
40
+ * @param {'server' | 'matter' | undefined} [mode] - The mode of the robotic vacuum cleaner. Defaults to undefined. Use 'server' or 'matter' if you want Apple Home compatibility.
41
+ * @param {number} [currentRunMode] - The current run mode of the robotic vacuum cleaner. Defaults to 1 (Idle).
42
+ * @param {RvcRunMode.ModeOption[]} [supportedRunModes] - The supported run modes for the robotic vacuum cleaner. Defaults to a predefined set of modes.
43
+ * @param {number} [currentCleanMode] - The current clean mode of the robotic vacuum cleaner. Defaults to 1 (Vacuum).
44
+ * @param {RvcCleanMode.ModeOption[]} [supportedCleanModes] - The supported clean modes for the robotic vacuum cleaner. Defaults to a predefined set of modes.
45
+ * @param {number | null} [currentPhase] - The current phase of the robotic vacuum cleaner. Defaults to null.
46
+ * @param {string[] | null} [phaseList] - The list of phases for the robotic vacuum cleaner. Defaults to null.
47
+ * @param {RvcOperationalState.OperationalState} [operationalState] - The current operational state of the robotic vacuum cleaner. Defaults to Docked.
48
+ * @param {RvcOperationalState.OperationalStateStruct[]} [operationalStateList] - The list of operational states for the robotic vacuum cleaner. Defaults to a predefined set of states.
49
+ * @param {ServiceArea.Area[]} [supportedAreas] - The supported areas for the robotic vacuum cleaner. Defaults to a predefined set of areas.
50
+ * @param {number[]} [selectedAreas] - The selected areas for the robotic vacuum cleaner. Defaults to an empty array (all areas allowed).
51
+ * @param {number} [currentArea] - The current area of the robotic vacuum cleaner. Defaults to 1 (Living).
52
+ * @param {ServiceArea.Map[]} [supportedMaps] - The supported maps for the robotic vacuum cleaner. Defaults to empty list.
53
+ */
54
+ constructor(name: string, serial: string, mode?: 'server' | 'matter' | undefined, currentRunMode?: number, supportedRunModes?: RvcRunMode.ModeOption[], currentCleanMode?: number, supportedCleanModes?: RvcCleanMode.ModeOption[], currentPhase?: number | null, phaseList?: string[] | null, operationalState?: RvcOperationalState.OperationalState, operationalStateList?: RvcOperationalState.OperationalStateStruct[], supportedAreas?: ServiceArea.Area[], selectedAreas?: number[], currentArea?: number, supportedMaps?: ServiceArea.Map[]);
55
+ /**
56
+ * Creates a default RvcRunMode Cluster Server.
57
+ *
58
+ * @param {number} [currentMode] - The current mode of the RvcRunMode cluster. Defaults to 1 (Idle).
59
+ * @param {RvcRunMode.ModeOption[]} [supportedModes] - The supported modes for the RvcRunMode cluster. Defaults to a predefined set of modes.
60
+ *
61
+ * @returns {this} The current MatterbridgeEndpoint instance for chaining.
62
+ *
63
+ * @remarks
64
+ * - supportedModes is a fixed attribute that defines the run modes available for the robotic vacuum cleaner.
65
+ */
66
+ createDefaultRvcRunModeClusterServer(currentMode?: number, supportedModes?: RvcRunMode.ModeOption[]): this;
67
+ /**
68
+ * Creates a default RvcCleanMode Cluster Server.
69
+ *
70
+ * @param {number} [currentMode] - The current mode of the RvcCleanMode cluster. Defaults to 1 (Vacuum).
71
+ * @param {RvcCleanMode.ModeOption[]} [supportedModes] - The supported modes for the RvcCleanMode cluster. Defaults to a predefined set of modes.
72
+ *
73
+ * @returns {this} The current MatterbridgeEndpoint instance for chaining.
74
+ *
75
+ * @remarks
76
+ * - supportedModes is a fixed attribute that defines the clean modes available for the robotic vacuum cleaner.
77
+ */
78
+ createDefaultRvcCleanModeClusterServer(currentMode?: number, supportedModes?: RvcCleanMode.ModeOption[]): this;
79
+ /**
80
+ * Creates a default ServiceArea Cluster Server.
81
+ *
82
+ * @param {ServiceArea.Area[]} [supportedAreas] - The supported areas for the ServiceArea cluster. Defaults to a predefined set of areas.
83
+ * @param {number[]} [selectedAreas] - The selected areas for the ServiceArea cluster. Defaults to an empty array (all areas allowed).
84
+ * @param {number} [currentArea] - The current areaId (not the index in the array!) of the ServiceArea cluster. Defaults to 1 (Living).
85
+ * @param {ServiceArea.Map[]} [supportedMaps] - The supported maps for the robotic vacuum cleaner. Defaults empty list.
86
+ * @returns {this} The current MatterbridgeEndpoint instance for chaining.
87
+ */
88
+ createDefaultServiceAreaClusterServer(supportedAreas?: ServiceArea.Area[], selectedAreas?: number[], currentArea?: number, supportedMaps?: ServiceArea.Map[]): this;
89
+ /**
90
+ * Creates a default RvcOperationalState Cluster Server.
91
+ *
92
+ * @param {string[] | null} [phaseList] - The list of phases for the RvcOperationalState cluster. Defaults to null.
93
+ * @param {number | null} [currentPhase] - The current phase (the index of the phaseList) of the RvcOperationalState cluster. Defaults to null.
94
+ * @param {RvcOperationalState.OperationalStateStruct[]} [operationalStateList] - The list of operational states for the RvcOperationalState cluster. Defaults to a predefined set of states.
95
+ * @param {RvcOperationalState.OperationalState} [operationalState] - The current operationalStateId of the RvcOperationalState cluster. Defaults to Docked.
96
+ * @param {RvcOperationalState.ErrorStateStruct} [operationalError] - The current operational error of the RvcOperationalState cluster. Defaults to NoError.
97
+ * @returns {this} The current MatterbridgeEndpoint instance for chaining.
98
+ */
99
+ createDefaultRvcOperationalStateClusterServer(phaseList?: string[] | null, currentPhase?: number | null, operationalStateList?: RvcOperationalState.OperationalStateStruct[], operationalState?: RvcOperationalState.OperationalState, operationalError?: RvcOperationalState.ErrorStateStruct): this;
100
+ }
101
+ export declare class MatterbridgeRvcRunModeServer extends RvcRunModeServer {
102
+ changeToMode(request: ModeBase.ChangeToModeRequest): MaybePromise<ModeBase.ChangeToModeResponse>;
103
+ }
104
+ export declare class MatterbridgeRvcCleanModeServer extends RvcCleanModeServer {
105
+ changeToMode(request: ModeBase.ChangeToModeRequest): MaybePromise<ModeBase.ChangeToModeResponse>;
106
+ }
107
+ export declare class MatterbridgeRvcOperationalStateServer extends RvcOperationalStateServer {
108
+ pause(): MaybePromise<OperationalState.OperationalCommandResponse>;
109
+ resume(): MaybePromise<OperationalState.OperationalCommandResponse>;
110
+ goHome(): MaybePromise<OperationalState.OperationalCommandResponse>;
111
+ }
112
+ //# sourceMappingURL=roboticVacuumCleaner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roboticVacuumCleaner.d.ts","sourceRoot":"","sources":["../../src/devices/roboticVacuumCleaner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAAoB,YAAY,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AACzF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAE3E,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CA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UAAU,EAAE,GAAG,IAAI;IAY9G;;;;;;;;OAQG;IACH,qCAAqC,CAAC,cAAc,CAAC,EAAE,WAAW,CAAC,IAAI,EAAE,EAAE,aAAa,CAAC,EAAE,MAAM,EAAE,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,IAAI;IAgCnK;;;;;;;;;OASG;IACH,6CAA6C,CAC3C,SAAS,GAAE,MAAM,EAAE,GAAG,IAAW,EACjC,YAAY,GAAE,MAAM,GAAG,IAAW,EAClC,oBAAoB,CAAC,EAAE,mBAAmB,CAAC,sBAAsB,EAAE,EACnE,gBAAgB,CAAC,EAAE,mBAAmB,CAAC,gBAAgB,EACvD,gBAAgB,CAAC,EAAE,mBAAmB,CAAC,gBAAgB,GACtD,IAAI;CAkBR;AAED,qBAAa,4BAA6B,SAAQ,gBAAgB;IACvD,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,mBAAmB,GAAG,YAAY,CAAC,QAAQ,CAAC,oBAAoB,CAAC;CAuB1G;AAED,qBAAa,8BAA+B,SAAQ,kBAAkB;IAC3D,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,mBAAmB,GAAG,YAAY,CAAC,QAAQ,CAAC,oBAAoB,CAAC;CAa1G;AAED,qBAAa,qCAAsC,SAAQ,yBAAyB;IACzE,KAAK,IAAI,YAAY,CAAC,gBAAgB,CAAC,0BAA0B,CAAC;IAalE,MAAM,IAAI,YAAY,CAAC,gBAAgB,CAAC,0BAA0B,CAAC;IAanE,MAAM,IAAI,YAAY,CAAC,gBAAgB,CAAC,0BAA0B,CAAC;CAa7E"}
@@ -1,3 +1,26 @@
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
1
24
  import { AreaNamespaceTag } from '@matter/main';
2
25
  import { RvcRunModeServer } from '@matter/main/behaviors/rvc-run-mode';
3
26
  import { RvcOperationalStateServer } from '@matter/main/behaviors/rvc-operational-state';
@@ -9,10 +32,30 @@ import { RvcOperationalState } from '@matter/main/clusters/rvc-operational-state
9
32
  import { ServiceArea } from '@matter/main/clusters/service-area';
10
33
  import { ModeBase } from '@matter/main/clusters/mode-base';
11
34
  import { OperationalState } from '@matter/main/clusters/operational-state';
35
+ // Matterbridge
12
36
  import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
13
37
  import { powerSource, roboticVacuumCleaner } from '../matterbridgeDeviceTypes.js';
14
38
  import { MatterbridgeServer, MatterbridgeServiceAreaServer } from '../matterbridgeBehaviors.js';
15
39
  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
+ */
16
59
  constructor(name, serial, mode = undefined, currentRunMode, supportedRunModes, currentCleanMode, supportedCleanModes, currentPhase = null, phaseList = null, operationalState, operationalStateList, supportedAreas, selectedAreas, currentArea, supportedMaps) {
17
60
  super([roboticVacuumCleaner, powerSource], { uniqueStorageKey: `${name.replaceAll(' ', '')}-${serial.replaceAll(' ', '')}`, mode }, true);
18
61
  this.createDefaultIdentifyClusterServer()
@@ -23,6 +66,17 @@ export class RoboticVacuumCleaner extends MatterbridgeEndpoint {
23
66
  .createDefaultRvcOperationalStateClusterServer(phaseList, currentPhase, operationalStateList, operationalState)
24
67
  .createDefaultServiceAreaClusterServer(supportedAreas, selectedAreas, currentArea, supportedMaps);
25
68
  }
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
+ */
26
80
  createDefaultRvcRunModeClusterServer(currentMode, supportedModes) {
27
81
  this.behaviors.require(MatterbridgeRvcRunModeServer, {
28
82
  supportedModes: supportedModes ?? [
@@ -35,6 +89,17 @@ export class RoboticVacuumCleaner extends MatterbridgeEndpoint {
35
89
  });
36
90
  return this;
37
91
  }
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
+ */
38
103
  createDefaultRvcCleanModeClusterServer(currentMode, supportedModes) {
39
104
  this.behaviors.require(MatterbridgeRvcCleanModeServer, {
40
105
  supportedModes: supportedModes ?? [
@@ -46,6 +111,15 @@ export class RoboticVacuumCleaner extends MatterbridgeEndpoint {
46
111
  });
47
112
  return this;
48
113
  }
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
+ */
49
123
  createDefaultServiceAreaClusterServer(supportedAreas, selectedAreas, currentArea, supportedMaps) {
50
124
  this.behaviors.require(MatterbridgeServiceAreaServer.with(ServiceArea.Feature.Maps), {
51
125
  supportedAreas: supportedAreas ?? [
@@ -72,11 +146,21 @@ export class RoboticVacuumCleaner extends MatterbridgeEndpoint {
72
146
  ],
73
147
  selectedAreas: selectedAreas ?? [],
74
148
  currentArea: currentArea ?? 1,
75
- supportedMaps: supportedMaps ?? [],
149
+ supportedMaps: supportedMaps ?? [], // Indicates that the device is currently unable to provide this information
76
150
  estimatedEndTime: null,
77
151
  });
78
152
  return this;
79
153
  }
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
+ */
80
164
  createDefaultRvcOperationalStateClusterServer(phaseList = null, currentPhase = null, operationalStateList, operationalState, operationalError) {
81
165
  this.behaviors.require(MatterbridgeRvcOperationalStateServer, {
82
166
  phaseList,
@@ -86,9 +170,9 @@ export class RoboticVacuumCleaner extends MatterbridgeEndpoint {
86
170
  { operationalStateId: RvcOperationalState.OperationalState.Running, operationalStateLabel: 'Running' },
87
171
  { operationalStateId: RvcOperationalState.OperationalState.Paused, operationalStateLabel: 'Paused' },
88
172
  { operationalStateId: RvcOperationalState.OperationalState.Error, operationalStateLabel: 'Error' },
89
- { operationalStateId: RvcOperationalState.OperationalState.SeekingCharger, operationalStateLabel: 'SeekingCharger' },
90
- { operationalStateId: RvcOperationalState.OperationalState.Charging, operationalStateLabel: 'Charging' },
91
- { operationalStateId: RvcOperationalState.OperationalState.Docked, operationalStateLabel: 'Docked' },
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
92
176
  ],
93
177
  operationalState: operationalState ?? RvcOperationalState.OperationalState.Docked,
94
178
  operationalError: operationalError ?? { errorStateId: RvcOperationalState.ErrorState.NoError, errorStateLabel: 'No Error', errorStateDetails: 'Fully operational' },
@@ -143,7 +227,7 @@ export class MatterbridgeRvcOperationalStateServer extends RvcOperationalStateSe
143
227
  device.log.info(`Pause (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
144
228
  device.commandHandler.executeHandler('pause', { request: {}, cluster: RvcOperationalStateServer.id, attributes: this.state, endpoint: this.endpoint });
145
229
  device.log.debug('MatterbridgeRvcOperationalStateServer: pause called setting operational state to Paused and currentMode to Idle');
146
- this.agent.get(MatterbridgeRvcRunModeServer).state.currentMode = 1;
230
+ this.agent.get(MatterbridgeRvcRunModeServer).state.currentMode = 1; // RvcRunMode.ModeTag.Idle
147
231
  this.state.operationalState = RvcOperationalState.OperationalState.Paused;
148
232
  this.state.operationalError = { errorStateId: RvcOperationalState.ErrorState.NoError, errorStateLabel: 'No Error', errorStateDetails: 'Fully operational' };
149
233
  return {
@@ -155,7 +239,7 @@ export class MatterbridgeRvcOperationalStateServer extends RvcOperationalStateSe
155
239
  device.log.info(`Resume (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
156
240
  device.commandHandler.executeHandler('resume', { request: {}, cluster: RvcOperationalStateServer.id, attributes: this.state, endpoint: this.endpoint });
157
241
  device.log.debug('MatterbridgeRvcOperationalStateServer: resume called setting operational state to Running and currentMode to Cleaning');
158
- this.agent.get(MatterbridgeRvcRunModeServer).state.currentMode = 2;
242
+ this.agent.get(MatterbridgeRvcRunModeServer).state.currentMode = 2; // RvcRunMode.ModeTag.Cleaning
159
243
  this.state.operationalState = RvcOperationalState.OperationalState.Running;
160
244
  this.state.operationalError = { errorStateId: RvcOperationalState.ErrorState.NoError, errorStateLabel: 'No Error', errorStateDetails: 'Fully operational' };
161
245
  return {
@@ -163,11 +247,12 @@ export class MatterbridgeRvcOperationalStateServer extends RvcOperationalStateSe
163
247
  };
164
248
  }
165
249
  goHome() {
250
+ // const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
166
251
  const device = this.endpoint.stateOf(MatterbridgeServer);
167
252
  device.log.info(`GoHome (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
168
253
  device.commandHandler.executeHandler('goHome', { request: {}, cluster: RvcOperationalStateServer.id, attributes: this.state, endpoint: this.endpoint });
169
254
  device.log.debug('MatterbridgeRvcOperationalStateServer: goHome called setting operational state to Docked and currentMode to Idle');
170
- this.agent.get(MatterbridgeRvcRunModeServer).state.currentMode = 1;
255
+ this.agent.get(MatterbridgeRvcRunModeServer).state.currentMode = 1; // RvcRunMode.ModeTag.Idle
171
256
  this.state.operationalState = RvcOperationalState.OperationalState.Docked;
172
257
  this.state.operationalError = { errorStateId: RvcOperationalState.ErrorState.NoError, errorStateLabel: 'No Error', errorStateDetails: 'Fully operational' };
173
258
  return {
@@ -175,3 +260,4 @@ export class MatterbridgeRvcOperationalStateServer extends RvcOperationalStateSe
175
260
  };
176
261
  }
177
262
  }
263
+ //# sourceMappingURL=roboticVacuumCleaner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roboticVacuumCleaner.js","sourceRoot":"","sources":["../../src/devices/robo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I,CAAC,KAAK,CAAC,gBAAgB,GAAG,EAAE,YAAY,EAAE,mBAAmB,CAAC,UAAU,CAAC,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,CAAC;QAC5J,OAAO;YACL,oBAAoB,EAAE,EAAE,YAAY,EAAE,gBAAgB,CAAC,UAAU,CAAC,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,iBAAiB,EAAE,mBAAmB,EAAE;SAClG,CAAC;IACnD,CAAC;CACF"}
@@ -0,0 +1,40 @@
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
+ import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
25
+ export declare class SolarPower extends MatterbridgeEndpoint {
26
+ /**
27
+ * Creates an instance of the SolarPower class.
28
+ *
29
+ * @param {string} name - The name of the SolarPower.
30
+ * @param {string} serial - The serial number of the SolarPower.
31
+ * @param {number} voltage - The voltage value in millivolts.
32
+ * @param {number} current - The current value in milliamperes.
33
+ * @param {number} power - The power value in milliwatts.
34
+ * @param {number} energyExported - The total production value in mW/h.
35
+ * @param {number} [absMinPower] - Indicate the minimum electrical power in mw that the ESA can consume when switched on. Defaults to `0` if not provided.
36
+ * @param {number} [absMaxPower] - Indicate the maximum electrical power in mw that the ESA can consume when switched on. Defaults to `0` if not provided.
37
+ */
38
+ constructor(name: string, serial: string, voltage?: number | bigint | null, current?: number | bigint | null, power?: number | bigint | null, energyExported?: number | bigint | null, absMinPower?: number, absMaxPower?: number);
39
+ }
40
+ //# sourceMappingURL=solarPower.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solarPower.d.ts","sourceRoot":"","sources":["../../src/devices/solarPower.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAOH,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAGlE,qBAAa,UAAW,SAAQ,oBAAoB;IAClD;;;;;;;;;;;OAWG;gBAED,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,MAAM,GAAG,MAAM,GAAG,IAAW,EACtC,OAAO,GAAE,MAAM,GAAG,MAAM,GAAG,IAAW,EACtC,KAAK,GAAE,MAAM,GAAG,MAAM,GAAG,IAAW,EACpC,cAAc,GAAE,MAAM,GAAG,MAAM,GAAG,IAAW,EAC7C,WAAW,GAAE,MAAU,EACvB,WAAW,GAAE,MAAU;CAoB1B"}
@@ -1,8 +1,45 @@
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
1
25
  import { PowerSourceTag } from '@matter/main';
2
26
  import { DeviceEnergyManagement } from '@matter/main/clusters/device-energy-management';
27
+ // Matterbridge
3
28
  import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
4
29
  import { deviceEnergyManagement, electricalSensor, solarPower, powerSource } from '../matterbridgeDeviceTypes.js';
5
30
  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
+ */
6
43
  constructor(name, serial, voltage = null, current = null, power = null, energyExported = null, absMinPower = 0, absMaxPower = 0) {
7
44
  super([solarPower, powerSource, electricalSensor, deviceEnergyManagement], {
8
45
  tagList: [{ mfgCode: null, namespaceId: PowerSourceTag.Solar.namespaceId, tag: PowerSourceTag.Solar.tag, label: null }],
@@ -19,3 +56,4 @@ export class SolarPower extends MatterbridgeEndpoint {
19
56
  .addRequiredClusterServers();
20
57
  }
21
58
  }
59
+ //# sourceMappingURL=solarPower.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solarPower.js","sourceRoot":"","sources":["../../src/devices/solarPower.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,UAAU;AACV,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAExF,eAAe;AACf,OAAO,EAAE,oB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