matterbridge 3.3.3-dev-20251017-2e6040a → 3.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (291) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/dist/broadcastServer.d.ts +105 -0
  3. package/dist/broadcastServer.d.ts.map +1 -0
  4. package/dist/broadcastServer.js +86 -1
  5. package/dist/broadcastServer.js.map +1 -0
  6. package/dist/broadcastServerTypes.d.ts +719 -0
  7. package/dist/broadcastServerTypes.d.ts.map +1 -0
  8. package/dist/broadcastServerTypes.js +24 -0
  9. package/dist/broadcastServerTypes.js.map +1 -0
  10. package/dist/cli.d.ts +26 -0
  11. package/dist/cli.d.ts.map +1 -0
  12. package/dist/cli.js +135 -5
  13. package/dist/cli.js.map +1 -0
  14. package/dist/cliEmitter.d.ts +50 -0
  15. package/dist/cliEmitter.d.ts.map +1 -0
  16. package/dist/cliEmitter.js +37 -0
  17. package/dist/cliEmitter.js.map +1 -0
  18. package/dist/cliHistory.d.ts +74 -0
  19. package/dist/cliHistory.d.ts.map +1 -0
  20. package/dist/cliHistory.js +44 -0
  21. package/dist/cliHistory.js.map +1 -0
  22. package/dist/clusters/export.d.ts +2 -0
  23. package/dist/clusters/export.d.ts.map +1 -0
  24. package/dist/clusters/export.js +2 -0
  25. package/dist/clusters/export.js.map +1 -0
  26. package/dist/defaultConfigSchema.d.ts +28 -0
  27. package/dist/defaultConfigSchema.d.ts.map +1 -0
  28. package/dist/defaultConfigSchema.js +24 -0
  29. package/dist/defaultConfigSchema.js.map +1 -0
  30. package/dist/deviceManager.d.ts +117 -0
  31. package/dist/deviceManager.d.ts.map +1 -0
  32. package/dist/deviceManager.js +124 -1
  33. package/dist/deviceManager.js.map +1 -0
  34. package/dist/devices/airConditioner.d.ts +98 -0
  35. package/dist/devices/airConditioner.d.ts.map +1 -0
  36. package/dist/devices/airConditioner.js +57 -0
  37. package/dist/devices/airConditioner.js.map +1 -0
  38. package/dist/devices/batteryStorage.d.ts +48 -0
  39. package/dist/devices/batteryStorage.d.ts.map +1 -0
  40. package/dist/devices/batteryStorage.js +48 -1
  41. package/dist/devices/batteryStorage.js.map +1 -0
  42. package/dist/devices/cooktop.d.ts +60 -0
  43. package/dist/devices/cooktop.d.ts.map +1 -0
  44. package/dist/devices/cooktop.js +55 -0
  45. package/dist/devices/cooktop.js.map +1 -0
  46. package/dist/devices/dishwasher.d.ts +71 -0
  47. package/dist/devices/dishwasher.d.ts.map +1 -0
  48. package/dist/devices/dishwasher.js +57 -0
  49. package/dist/devices/dishwasher.js.map +1 -0
  50. package/dist/devices/evse.d.ts +75 -0
  51. package/dist/devices/evse.d.ts.map +1 -0
  52. package/dist/devices/evse.js +74 -10
  53. package/dist/devices/evse.js.map +1 -0
  54. package/dist/devices/export.d.ts +17 -0
  55. package/dist/devices/export.d.ts.map +1 -0
  56. package/dist/devices/export.js +5 -0
  57. package/dist/devices/export.js.map +1 -0
  58. package/dist/devices/extractorHood.d.ts +46 -0
  59. package/dist/devices/extractorHood.d.ts.map +1 -0
  60. package/dist/devices/extractorHood.js +42 -0
  61. package/dist/devices/extractorHood.js.map +1 -0
  62. package/dist/devices/heatPump.d.ts +47 -0
  63. package/dist/devices/heatPump.d.ts.map +1 -0
  64. package/dist/devices/heatPump.js +50 -2
  65. package/dist/devices/heatPump.js.map +1 -0
  66. package/dist/devices/laundryDryer.d.ts +67 -0
  67. package/dist/devices/laundryDryer.d.ts.map +1 -0
  68. package/dist/devices/laundryDryer.js +62 -3
  69. package/dist/devices/laundryDryer.js.map +1 -0
  70. package/dist/devices/laundryWasher.d.ts +81 -0
  71. package/dist/devices/laundryWasher.d.ts.map +1 -0
  72. package/dist/devices/laundryWasher.js +70 -4
  73. package/dist/devices/laundryWasher.js.map +1 -0
  74. package/dist/devices/microwaveOven.d.ts +168 -0
  75. package/dist/devices/microwaveOven.d.ts.map +1 -0
  76. package/dist/devices/microwaveOven.js +88 -5
  77. package/dist/devices/microwaveOven.js.map +1 -0
  78. package/dist/devices/oven.d.ts +105 -0
  79. package/dist/devices/oven.d.ts.map +1 -0
  80. package/dist/devices/oven.js +85 -0
  81. package/dist/devices/oven.js.map +1 -0
  82. package/dist/devices/refrigerator.d.ts +118 -0
  83. package/dist/devices/refrigerator.d.ts.map +1 -0
  84. package/dist/devices/refrigerator.js +102 -0
  85. package/dist/devices/refrigerator.js.map +1 -0
  86. package/dist/devices/roboticVacuumCleaner.d.ts +112 -0
  87. package/dist/devices/roboticVacuumCleaner.d.ts.map +1 -0
  88. package/dist/devices/roboticVacuumCleaner.js +100 -9
  89. package/dist/devices/roboticVacuumCleaner.js.map +1 -0
  90. package/dist/devices/solarPower.d.ts +40 -0
  91. package/dist/devices/solarPower.d.ts.map +1 -0
  92. package/dist/devices/solarPower.js +38 -0
  93. package/dist/devices/solarPower.js.map +1 -0
  94. package/dist/devices/speaker.d.ts +87 -0
  95. package/dist/devices/speaker.d.ts.map +1 -0
  96. package/dist/devices/speaker.js +84 -0
  97. package/dist/devices/speaker.js.map +1 -0
  98. package/dist/devices/temperatureControl.d.ts +166 -0
  99. package/dist/devices/temperatureControl.d.ts.map +1 -0
  100. package/dist/devices/temperatureControl.js +25 -3
  101. package/dist/devices/temperatureControl.js.map +1 -0
  102. package/dist/devices/waterHeater.d.ts +111 -0
  103. package/dist/devices/waterHeater.d.ts.map +1 -0
  104. package/dist/devices/waterHeater.js +82 -2
  105. package/dist/devices/waterHeater.js.map +1 -0
  106. package/dist/dgram/coap.d.ts +205 -0
  107. package/dist/dgram/coap.d.ts.map +1 -0
  108. package/dist/dgram/coap.js +126 -13
  109. package/dist/dgram/coap.js.map +1 -0
  110. package/dist/dgram/dgram.d.ts +141 -0
  111. package/dist/dgram/dgram.d.ts.map +1 -0
  112. package/dist/dgram/dgram.js +114 -2
  113. package/dist/dgram/dgram.js.map +1 -0
  114. package/dist/dgram/mb_coap.d.ts +24 -0
  115. package/dist/dgram/mb_coap.d.ts.map +1 -0
  116. package/dist/dgram/mb_coap.js +41 -3
  117. package/dist/dgram/mb_coap.js.map +1 -0
  118. package/dist/dgram/mb_mdns.d.ts +24 -0
  119. package/dist/dgram/mb_mdns.d.ts.map +1 -0
  120. package/dist/dgram/mb_mdns.js +80 -15
  121. package/dist/dgram/mb_mdns.js.map +1 -0
  122. package/dist/dgram/mdns.d.ts +290 -0
  123. package/dist/dgram/mdns.d.ts.map +1 -0
  124. package/dist/dgram/mdns.js +299 -137
  125. package/dist/dgram/mdns.js.map +1 -0
  126. package/dist/dgram/multicast.d.ts +67 -0
  127. package/dist/dgram/multicast.d.ts.map +1 -0
  128. package/dist/dgram/multicast.js +62 -1
  129. package/dist/dgram/multicast.js.map +1 -0
  130. package/dist/dgram/unicast.d.ts +56 -0
  131. package/dist/dgram/unicast.d.ts.map +1 -0
  132. package/dist/dgram/unicast.js +54 -0
  133. package/dist/dgram/unicast.js.map +1 -0
  134. package/dist/frontend.d.ts +235 -0
  135. package/dist/frontend.d.ts.map +1 -0
  136. package/dist/frontend.js +415 -29
  137. package/dist/frontend.js.map +1 -0
  138. package/dist/frontendTypes.d.ts +529 -0
  139. package/dist/frontendTypes.d.ts.map +1 -0
  140. package/dist/frontendTypes.js +45 -0
  141. package/dist/frontendTypes.js.map +1 -0
  142. package/dist/helpers.d.ts +48 -0
  143. package/dist/helpers.d.ts.map +1 -0
  144. package/dist/helpers.js +53 -0
  145. package/dist/helpers.js.map +1 -0
  146. package/dist/index.d.ts +33 -0
  147. package/dist/index.d.ts.map +1 -0
  148. package/dist/index.js +25 -0
  149. package/dist/index.js.map +1 -0
  150. package/dist/logger/export.d.ts +2 -0
  151. package/dist/logger/export.d.ts.map +1 -0
  152. package/dist/logger/export.js +1 -0
  153. package/dist/logger/export.js.map +1 -0
  154. package/dist/matter/behaviors.d.ts +2 -0
  155. package/dist/matter/behaviors.d.ts.map +1 -0
  156. package/dist/matter/behaviors.js +2 -0
  157. package/dist/matter/behaviors.js.map +1 -0
  158. package/dist/matter/clusters.d.ts +2 -0
  159. package/dist/matter/clusters.d.ts.map +1 -0
  160. package/dist/matter/clusters.js +2 -0
  161. package/dist/matter/clusters.js.map +1 -0
  162. package/dist/matter/devices.d.ts +2 -0
  163. package/dist/matter/devices.d.ts.map +1 -0
  164. package/dist/matter/devices.js +2 -0
  165. package/dist/matter/devices.js.map +1 -0
  166. package/dist/matter/endpoints.d.ts +2 -0
  167. package/dist/matter/endpoints.d.ts.map +1 -0
  168. package/dist/matter/endpoints.js +2 -0
  169. package/dist/matter/endpoints.js.map +1 -0
  170. package/dist/matter/export.d.ts +5 -0
  171. package/dist/matter/export.d.ts.map +1 -0
  172. package/dist/matter/export.js +3 -0
  173. package/dist/matter/export.js.map +1 -0
  174. package/dist/matter/types.d.ts +3 -0
  175. package/dist/matter/types.d.ts.map +1 -0
  176. package/dist/matter/types.js +3 -0
  177. package/dist/matter/types.js.map +1 -0
  178. package/dist/matterbridge.d.ts +469 -0
  179. package/dist/matterbridge.d.ts.map +1 -0
  180. package/dist/matterbridge.js +795 -45
  181. package/dist/matterbridge.js.map +1 -0
  182. package/dist/matterbridgeAccessoryPlatform.d.ts +42 -0
  183. package/dist/matterbridgeAccessoryPlatform.d.ts.map +1 -0
  184. package/dist/matterbridgeAccessoryPlatform.js +36 -0
  185. package/dist/matterbridgeAccessoryPlatform.js.map +1 -0
  186. package/dist/matterbridgeBehaviors.d.ts +2399 -0
  187. package/dist/matterbridgeBehaviors.d.ts.map +1 -0
  188. package/dist/matterbridgeBehaviors.js +71 -5
  189. package/dist/matterbridgeBehaviors.js.map +1 -0
  190. package/dist/matterbridgeDeviceTypes.d.ts +761 -0
  191. package/dist/matterbridgeDeviceTypes.d.ts.map +1 -0
  192. package/dist/matterbridgeDeviceTypes.js +630 -17
  193. package/dist/matterbridgeDeviceTypes.js.map +1 -0
  194. package/dist/matterbridgeDynamicPlatform.d.ts +42 -0
  195. package/dist/matterbridgeDynamicPlatform.d.ts.map +1 -0
  196. package/dist/matterbridgeDynamicPlatform.js +36 -0
  197. package/dist/matterbridgeDynamicPlatform.js.map +1 -0
  198. package/dist/matterbridgeEndpoint.d.ts +1545 -0
  199. package/dist/matterbridgeEndpoint.d.ts.map +1 -0
  200. package/dist/matterbridgeEndpoint.js +1412 -58
  201. package/dist/matterbridgeEndpoint.js.map +1 -0
  202. package/dist/matterbridgeEndpointHelpers.d.ts +560 -0
  203. package/dist/matterbridgeEndpointHelpers.d.ts.map +1 -0
  204. package/dist/matterbridgeEndpointHelpers.js +368 -10
  205. package/dist/matterbridgeEndpointHelpers.js.map +1 -0
  206. package/dist/matterbridgePlatform.d.ts +402 -0
  207. package/dist/matterbridgePlatform.d.ts.map +1 -0
  208. package/dist/matterbridgePlatform.js +341 -1
  209. package/dist/matterbridgePlatform.js.map +1 -0
  210. package/dist/matterbridgeTypes.d.ts +209 -0
  211. package/dist/matterbridgeTypes.d.ts.map +1 -0
  212. package/dist/matterbridgeTypes.js +26 -0
  213. package/dist/matterbridgeTypes.js.map +1 -0
  214. package/dist/pluginManager.d.ts +353 -0
  215. package/dist/pluginManager.d.ts.map +1 -0
  216. package/dist/pluginManager.js +325 -3
  217. package/dist/pluginManager.js.map +1 -0
  218. package/dist/shelly.d.ts +174 -0
  219. package/dist/shelly.d.ts.map +1 -0
  220. package/dist/shelly.js +168 -7
  221. package/dist/shelly.js.map +1 -0
  222. package/dist/storage/export.d.ts +2 -0
  223. package/dist/storage/export.d.ts.map +1 -0
  224. package/dist/storage/export.js +1 -0
  225. package/dist/storage/export.js.map +1 -0
  226. package/dist/update.d.ts +75 -0
  227. package/dist/update.d.ts.map +1 -0
  228. package/dist/update.js +69 -0
  229. package/dist/update.js.map +1 -0
  230. package/dist/utils/colorUtils.d.ts +99 -0
  231. package/dist/utils/colorUtils.d.ts.map +1 -0
  232. package/dist/utils/colorUtils.js +97 -2
  233. package/dist/utils/colorUtils.js.map +1 -0
  234. package/dist/utils/commandLine.d.ts +59 -0
  235. package/dist/utils/commandLine.d.ts.map +1 -0
  236. package/dist/utils/commandLine.js +54 -0
  237. package/dist/utils/commandLine.js.map +1 -0
  238. package/dist/utils/copyDirectory.d.ts +33 -0
  239. package/dist/utils/copyDirectory.d.ts.map +1 -0
  240. package/dist/utils/copyDirectory.js +38 -1
  241. package/dist/utils/copyDirectory.js.map +1 -0
  242. package/dist/utils/createDirectory.d.ts +34 -0
  243. package/dist/utils/createDirectory.d.ts.map +1 -0
  244. package/dist/utils/createDirectory.js +33 -0
  245. package/dist/utils/createDirectory.js.map +1 -0
  246. package/dist/utils/createZip.d.ts +39 -0
  247. package/dist/utils/createZip.d.ts.map +1 -0
  248. package/dist/utils/createZip.js +47 -2
  249. package/dist/utils/createZip.js.map +1 -0
  250. package/dist/utils/deepCopy.d.ts +32 -0
  251. package/dist/utils/deepCopy.d.ts.map +1 -0
  252. package/dist/utils/deepCopy.js +39 -0
  253. package/dist/utils/deepCopy.js.map +1 -0
  254. package/dist/utils/deepEqual.d.ts +54 -0
  255. package/dist/utils/deepEqual.d.ts.map +1 -0
  256. package/dist/utils/deepEqual.js +72 -1
  257. package/dist/utils/deepEqual.js.map +1 -0
  258. package/dist/utils/error.d.ts +44 -0
  259. package/dist/utils/error.d.ts.map +1 -0
  260. package/dist/utils/error.js +41 -0
  261. package/dist/utils/error.js.map +1 -0
  262. package/dist/utils/export.d.ts +13 -0
  263. package/dist/utils/export.d.ts.map +1 -0
  264. package/dist/utils/export.js +1 -0
  265. package/dist/utils/export.js.map +1 -0
  266. package/dist/utils/hex.d.ts +89 -0
  267. package/dist/utils/hex.d.ts.map +1 -0
  268. package/dist/utils/hex.js +124 -0
  269. package/dist/utils/hex.js.map +1 -0
  270. package/dist/utils/isvalid.d.ts +103 -0
  271. package/dist/utils/isvalid.d.ts.map +1 -0
  272. package/dist/utils/isvalid.js +101 -0
  273. package/dist/utils/isvalid.js.map +1 -0
  274. package/dist/utils/jestHelpers.d.ts +137 -0
  275. package/dist/utils/jestHelpers.d.ts.map +1 -0
  276. package/dist/utils/jestHelpers.js +153 -3
  277. package/dist/utils/jestHelpers.js.map +1 -0
  278. package/dist/utils/network.d.ts +115 -0
  279. package/dist/utils/network.d.ts.map +1 -0
  280. package/dist/utils/network.js +108 -5
  281. package/dist/utils/network.js.map +1 -0
  282. package/dist/utils/spawn.d.ts +35 -0
  283. package/dist/utils/spawn.d.ts.map +1 -0
  284. package/dist/utils/spawn.js +71 -0
  285. package/dist/utils/spawn.js.map +1 -0
  286. package/dist/utils/wait.d.ts +54 -0
  287. package/dist/utils/wait.d.ts.map +1 -0
  288. package/dist/utils/wait.js +60 -8
  289. package/dist/utils/wait.js.map +1 -0
  290. package/npm-shrinkwrap.json +2 -2
  291. package/package.json +2 -1
@@ -1,8 +1,64 @@
1
+ /**
2
+ * @description This file contains the AirConditioner class.
3
+ * @file src/devices/airConditioner.ts
4
+ * @author Luca Liguori
5
+ * @created 2025-09-04
6
+ * @version 1.0.0
7
+ * @license Apache-2.0
8
+ *
9
+ * Copyright 2025, 2026, 2027 Luca Liguori.
10
+ *
11
+ * Licensed under the Apache License, Version 2.0 (the "License");
12
+ * you may not use this file except in compliance with the License.
13
+ * You may obtain a copy of the License at
14
+ *
15
+ * http://www.apache.org/licenses/LICENSE-2.0
16
+ *
17
+ * Unless required by applicable law or agreed to in writing, software
18
+ * distributed under the License is distributed on an "AS IS" BASIS,
19
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
+ * See the License for the specific language governing permissions and
21
+ * limitations under the License.
22
+ */
23
+ // Imports from @matter
1
24
  import { ThermostatUserInterfaceConfiguration } from '@matter/main/clusters/thermostat-user-interface-configuration';
25
+ // Matterbridge
2
26
  import { FanControl } from '@matter/main/clusters/fan-control';
3
27
  import { airConditioner, powerSource } from '../matterbridgeDeviceTypes.js';
4
28
  import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
5
29
  export class AirConditioner extends MatterbridgeEndpoint {
30
+ /**
31
+ * Creates an instance of the AirConditioner class.
32
+ *
33
+ * A Room Air Conditioner is a device which at a minimum is capable of being turned on and off and of controlling the temperature in the living space.
34
+ * A Room Air Conditioner MAY also support additional capabilities via endpoint composition.
35
+ * The DF (Dead Front) feature is required for the On/Off cluster in this device type.
36
+ *
37
+ * @param {string} name - The name of the air conditioner.
38
+ * @param {string} serial - The serial number of the air conditioner.
39
+ * @param {AirConditionerOptions} [options] - Optional configuration values. Missing fields use defaults.
40
+ *
41
+ * Options defaults:
42
+ * - localTemperature: 23
43
+ * - occupiedHeatingSetpoint: 21
44
+ * - occupiedCoolingSetpoint: 25
45
+ * - minSetpointDeadBand: 1
46
+ * - minHeatSetpointLimit: 0
47
+ * - maxHeatSetpointLimit: 50
48
+ * - minCoolSetpointLimit: 0
49
+ * - maxCoolSetpointLimit: 50
50
+ * - temperatureDisplayMode: Celsius
51
+ * - keypadLockout: NoLockout
52
+ * - scheduleProgrammingVisibility: ScheduleProgrammingPermitted
53
+ * - fanMode: Off
54
+ * - fanModeSequence: OffLowMedHighAuto
55
+ * - percentSetting: 0
56
+ * - percentCurrent: 0
57
+ *
58
+ * @returns {AirConditioner} The AirConditioner instance.
59
+ *
60
+ * @remarks Not supported by Google Home.
61
+ */
6
62
  constructor(name, serial, options = {}) {
7
63
  const { localTemperature = 23, occupiedHeatingSetpoint = 21, occupiedCoolingSetpoint = 25, minSetpointDeadBand = 1, minHeatSetpointLimit = 0, maxHeatSetpointLimit = 50, minCoolSetpointLimit = 0, maxCoolSetpointLimit = 50, temperatureDisplayMode = ThermostatUserInterfaceConfiguration.TemperatureDisplayMode.Celsius, keypadLockout = ThermostatUserInterfaceConfiguration.KeypadLockout.NoLockout, scheduleProgrammingVisibility = ThermostatUserInterfaceConfiguration.ScheduleProgrammingVisibility.ScheduleProgrammingPermitted, fanMode = FanControl.FanMode.Off, fanModeSequence = FanControl.FanModeSequence.OffLowMedHighAuto, percentSetting = 0, percentCurrent = 0, } = options;
8
64
  super([airConditioner, powerSource], { uniqueStorageKey: `${name.replaceAll(' ', '')}-${serial.replaceAll(' ', '')}` }, true);
@@ -15,3 +71,4 @@ export class AirConditioner extends MatterbridgeEndpoint {
15
71
  this.createDefaultFanControlClusterServer(fanMode, fanModeSequence, percentSetting, percentCurrent);
16
72
  }
17
73
  }
74
+ //# sourceMappingURL=airConditioner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"airConditioner.js","sourceRoot":"","sources":["../../src/devices/airConditioner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,uBAAuB;AACvB,OAAO,EAAE,oCAAoC,EAAE,MAAM,+DAA+D,CAAC;AACrH,eAAe;AACf,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAE/D,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAwClE,MAAM,OAAO,cAAe,SAAQ,oBAAoB;IACtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,YAAY,IAAY,EAAE,MAAc,EAAE,UAAiC,EAAE;QAC3E,MAAM,EACJ,gBAAgB,GAAG,EAAE,EACrB,uBAAuB,GAAG,EAAE,EAC5B,uBAAuB,GAAG,EAAE,EAC5B,mBAAmB,GAAG,CAAC,EACvB,oBAAoB,GAAG,CAAC,EACxB,oBAAoB,GAAG,EAAE,EACzB,oBAAoB,GAAG,CAAC,EACxB,oBAAoB,GAAG,EAAE,EACzB,sBAAsB,GAAG,oCAAoC,CAAC,sBAAsB,CAAC,OAAO,EAC5F,aAAa,GAAG,oCAAoC,CAAC,aAAa,CAAC,SAAS,EAC5E,6BAA6B,GAAG,oCAAoC,CAAC,6BAA6B,CAAC,4BAA4B,EAC/H,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,EAChC,eAAe,GAAG,UAAU,CAAC,eAAe,CAAC,iBAAiB,EAC9D,cAAc,GAAG,CAAC,EAClB,cAAc,GAAG,CAAC,GACnB,GAAG,OAAO,CAAC;QACZ,KAAK,CAAC,CAAC,cAAc,EAAE,WAAW,CAAC,EAAE,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;QAC9H,IAAI,CAAC,kCAAkC,EAAE,CAAC;QAC1C,IAAI,CAAC,0CAA0C,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,8BAA8B,CAAC,CAAC;QAC9H,IAAI,CAAC,0CAA0C,EAAE,CAAC;QAClD,IAAI,CAAC,iCAAiC,CAAC,IAAI,CAAC,CAAC;QAC7C,IAAI,CAAC,oCAAoC,CAAC,gBAAgB,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,CAAC;QAC3N,IAAI,CAAC,8DAA8D,CAAC,sBAAsB,EAAE,aAAa,EAAE,6BAA6B,CAAC,CAAC;QAC1I,IAAI,CAAC,oCAAoC,CAAC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC;IACtG,CAAC;CACF"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * @description This file contains the BatteryStorage class.
3
+ * @file src/devices/batteryStorage.ts
4
+ * @author Luca Liguori
5
+ * @contributor Ludovic BOUÉ
6
+ * @created 2025-06-20
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 { PowerSource } from '@matter/main/clusters/power-source';
25
+ import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
26
+ export declare class BatteryStorage extends MatterbridgeEndpoint {
27
+ /**
28
+ * Creates an instance of the BatteryStorage class.
29
+ *
30
+ * @param {string} name - The name of the BatteryStorage.
31
+ * @param {string} serial - The serial number of the BatteryStorage.
32
+ * @param {number} [batPercentRemaining] - The percentage of battery remaining, defaults to `100` if not provided.
33
+ * @param {PowerSource.BatChargeLevel} [batChargeLevel] - The battery charge level (default: PowerSource.BatChargeLevel.Ok).
34
+ * @param {number} voltage - The voltage value in millivolts.
35
+ * @param {number} current - The current value in milliamperes.
36
+ * @param {number} power - The power value in milliwatts.
37
+ * @param {number} energyImported - The total production value in mW/h.
38
+ * @param {number} energyExported - The total production value in mW/h.
39
+ * @param {number} [absMinPower] - Indicate the minimum electrical power in mw that the ESA can consume when switched on. Defaults to `0` if not provided.
40
+ * @param {number} [absMaxPower] - Indicate the maximum electrical power in mw that the ESA can consume when switched on. Defaults to `0` if not provided.
41
+ *
42
+ * @remarks
43
+ * - A battery storage inverter that can charge its battery at a maximum power of 2000W and can
44
+ * discharge the battery at a maximum power of 3000W, would have a absMinPower: -3000W, absMaxPower: 2000W.
45
+ */
46
+ constructor(name: string, serial: string, batPercentRemaining?: number, batChargeLevel?: PowerSource.BatChargeLevel, voltage?: number | bigint | null, current?: number | bigint | null, power?: number | bigint | null, energyImported?: number | bigint | null, energyExported?: number | bigint | null, absMinPower?: number, absMaxPower?: number);
47
+ }
48
+ //# sourceMappingURL=batteryStorage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batteryStorage.d.ts","sourceRoot":"","sources":["../../src/devices/batteryStorage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAKH,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAGjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAGlE,qBAAa,cAAe,SAAQ,oBAAoB;IACtD;;;;;;;;;;;;;;;;;;OAkBG;gBAED,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,mBAAmB,GAAE,MAAY,EACjC,cAAc,GAAE,WAAW,CAAC,cAA8C,EAC1E,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,cAAc,GAAE,MAAM,GAAG,MAAM,GAAG,IAAW,EAC7C,WAAW,GAAE,MAAU,EACvB,WAAW,GAAE,MAAU;CA0B1B"}
@@ -1,9 +1,53 @@
1
+ /**
2
+ * @description This file contains the BatteryStorage class.
3
+ * @file src/devices/batteryStorage.ts
4
+ * @author Luca Liguori
5
+ * @contributor Ludovic BOUÉ
6
+ * @created 2025-06-20
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';
3
27
  import { PowerSource } from '@matter/main/clusters/power-source';
28
+ // Matterbridge
4
29
  import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
5
30
  import { deviceEnergyManagement, electricalSensor, batteryStorage, powerSource } from '../matterbridgeDeviceTypes.js';
6
31
  export class BatteryStorage extends MatterbridgeEndpoint {
32
+ /**
33
+ * Creates an instance of the BatteryStorage class.
34
+ *
35
+ * @param {string} name - The name of the BatteryStorage.
36
+ * @param {string} serial - The serial number of the BatteryStorage.
37
+ * @param {number} [batPercentRemaining] - The percentage of battery remaining, defaults to `100` if not provided.
38
+ * @param {PowerSource.BatChargeLevel} [batChargeLevel] - The battery charge level (default: PowerSource.BatChargeLevel.Ok).
39
+ * @param {number} voltage - The voltage value in millivolts.
40
+ * @param {number} current - The current value in milliamperes.
41
+ * @param {number} power - The power value in milliwatts.
42
+ * @param {number} energyImported - The total production value in mW/h.
43
+ * @param {number} energyExported - The total production value in mW/h.
44
+ * @param {number} [absMinPower] - Indicate the minimum electrical power in mw that the ESA can consume when switched on. Defaults to `0` if not provided.
45
+ * @param {number} [absMaxPower] - Indicate the maximum electrical power in mw that the ESA can consume when switched on. Defaults to `0` if not provided.
46
+ *
47
+ * @remarks
48
+ * - A battery storage inverter that can charge its battery at a maximum power of 2000W and can
49
+ * discharge the battery at a maximum power of 3000W, would have a absMinPower: -3000W, absMaxPower: 2000W.
50
+ */
7
51
  constructor(name, serial, batPercentRemaining = 100, batChargeLevel = PowerSource.BatChargeLevel.Ok, voltage = null, current = null, power = null, energyImported = null, energyExported = null, absMinPower = 0, absMaxPower = 0) {
8
52
  super([batteryStorage, electricalSensor, deviceEnergyManagement], { id: `${name.replaceAll(' ', '')}-${serial.replaceAll(' ', '')}` }, true);
9
53
  this.createDefaultIdentifyClusterServer()
@@ -14,10 +58,12 @@ export class BatteryStorage extends MatterbridgeEndpoint {
14
58
  .createDefaultDeviceEnergyManagementClusterServer(DeviceEnergyManagement.EsaType.BatteryStorage, true, DeviceEnergyManagement.EsaState.Online, absMinPower, absMaxPower)
15
59
  .createDefaultDeviceEnergyManagementModeClusterServer()
16
60
  .addRequiredClusterServers();
61
+ // Add separate PowerSource child devices cause in matter.js the PowerSource cluster is not supported with both features Wired and Battery.
62
+ // Probably this is also an error in the specification...
17
63
  this.addChildDeviceType('BatteryPowerSource', powerSource, {
18
64
  tagList: [{ mfgCode: null, namespaceId: PowerSourceTag.Battery.namespaceId, tag: PowerSourceTag.Battery.tag, label: null }],
19
65
  })
20
- .createDefaultPowerSourceRechargeableBatteryClusterServer(batPercentRemaining, batChargeLevel, 24_000)
66
+ .createDefaultPowerSourceRechargeableBatteryClusterServer(batPercentRemaining, batChargeLevel, 24_000) // Battery voltage in mV (24V).
21
67
  .addRequiredClusterServers();
22
68
  this.addChildDeviceType('GridPowerSource', powerSource, {
23
69
  tagList: [{ mfgCode: null, namespaceId: PowerSourceTag.Grid.namespaceId, tag: PowerSourceTag.Grid.tag, label: null }],
@@ -26,3 +72,4 @@ export class BatteryStorage extends MatterbridgeEndpoint {
26
72
  .addRequiredClusterServers();
27
73
  }
28
74
  }
75
+ //# sourceMappingURL=batteryStorage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batteryStorage.js","sourceRoot":"","sources":["../../src/devices/batteryStorage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,UAAU;AACV,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEjE,eAAe;AACf,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAEtH,MAAM,OAAO,cAAe,SAAQ,oBAAoB;IACtD;;;;;;;;;;;;;;;;;;OAkBG;IACH,YACE,IAAY,EACZ,MAAc,EACd,sBAA8B,GAAG,EACj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QAE/B,IAAI,CAAC,kBAAkB,CAAC,iBAAiB,EAAE,WAAW,EAAE;YACtD,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,cAAc,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;SACtH,CAAC;aACC,0CAA0C,EAAE;aAC5C,yBAAyB,EAAE,CAAC;IACjC,CAAC;CACF"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * @description This file contains the Cooktop class.
3
+ * @file src/devices/cooktop.ts
4
+ * @author Luca Liguori
5
+ * @created 2025-05-25
6
+ * @version 1.1.0
7
+ * @license Apache-2.0
8
+ *
9
+ * Copyright 2025, 2026, 2027 Luca Liguori.
10
+ *
11
+ * Licensed under the Apache License, Version 2.0 (the "License");
12
+ * you may not use this file except in compliance with the License.
13
+ * You may obtain a copy of the License at
14
+ *
15
+ * http://www.apache.org/licenses/LICENSE-2.0
16
+ *
17
+ * Unless required by applicable law or agreed to in writing, software
18
+ * distributed under the License is distributed on an "AS IS" BASIS,
19
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
+ * See the License for the specific language governing permissions and
21
+ * limitations under the License.
22
+ */
23
+ import { Semtag } from '@matter/types';
24
+ import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
25
+ export declare class Cooktop extends MatterbridgeEndpoint {
26
+ /**
27
+ * Creates an instance of the Cooktop class.
28
+ *
29
+ * @param {string} name - The name of the cooktop.
30
+ * @param {string} serial - The serial number of the cooktop.
31
+ *
32
+ * @remarks
33
+ * 13.8 A cooktop is a cooking surface that heats food either by transferring currents from an electromagnetic
34
+ * field located below the glass surface directly to the magnetic induction cookware placed
35
+ * above or through traditional gas or electric burners.
36
+ *
37
+ * 13.8.4 A Cooktop SHALL be composed of zero or more endpoints with the Cook Surface device type.
38
+ * An Cooktop is always defined via endpoint composition.
39
+ * - Use `addSurface` to add one or more surfaces to the cooktop.
40
+ */
41
+ constructor(name: string, serial: string);
42
+ /**
43
+ * Adds a surface to the cooktop.
44
+ *
45
+ * @param {string} name - The name of the surface.
46
+ * @param {Semtag[]} tagList - The tagList associated with the surface.
47
+ * @param {number} selectedTemperatureLevel - The selected temperature level as an index of the supportedTemperatureLevels array. Defaults to 2 (which corresponds to 'Level 3').
48
+ * @param {string[]} supportedTemperatureLevels - The list of supported temperature levels for the surface. Defaults to ['Level 1', 'Level 2', 'Level 3', 'Level 4', 'Level 5'].
49
+ *
50
+ * @returns {MatterbridgeEndpoint} The MatterbridgeEndpoint instance representing the surface.
51
+ *
52
+ * @remarks
53
+ * 13.7 A Cook Surface device type represents a heating object on a cooktop or other similar device. It
54
+ * SHALL only be used when composed as part of another device type.
55
+ *
56
+ * The OnOff cluster is off only mandatory for all Cook Surface devices!
57
+ */
58
+ addSurface(name: string, tagList: Semtag[], selectedTemperatureLevel?: number, supportedTemperatureLevels?: string[]): MatterbridgeEndpoint;
59
+ }
60
+ //# sourceMappingURL=cooktop.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cooktop.d.ts","sourceRoot":"","sources":["../../src/devices/cooktop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAIvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAIlE,qBAAa,OAAQ,SAAQ,oBAAoB;IAC/C;;;;;;;;;;;;;;OAcG;gBACS,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IASxC;;;;;;;;;;;;;;;OAeG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,wBAAwB,GAAE,MAAU,EAAE,0BAA0B,GAAE,MAAM,EAA4D,GAAG,oBAAoB;CAQxM"}
@@ -1,7 +1,45 @@
1
+ /**
2
+ * @description This file contains the Cooktop class.
3
+ * @file src/devices/cooktop.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
+ // Matterbridge
1
24
  import { cookSurface, cooktop, powerSource } from '../matterbridgeDeviceTypes.js';
2
25
  import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
3
26
  import { createLevelTemperatureControlClusterServer } from './temperatureControl.js';
4
27
  export class Cooktop extends MatterbridgeEndpoint {
28
+ /**
29
+ * Creates an instance of the Cooktop class.
30
+ *
31
+ * @param {string} name - The name of the cooktop.
32
+ * @param {string} serial - The serial number of the cooktop.
33
+ *
34
+ * @remarks
35
+ * 13.8 A cooktop is a cooking surface that heats food either by transferring currents from an electromagnetic
36
+ * field located below the glass surface directly to the magnetic induction cookware placed
37
+ * above or through traditional gas or electric burners.
38
+ *
39
+ * 13.8.4 A Cooktop SHALL be composed of zero or more endpoints with the Cook Surface device type.
40
+ * An Cooktop is always defined via endpoint composition.
41
+ * - Use `addSurface` to add one or more surfaces to the cooktop.
42
+ */
5
43
  constructor(name, serial) {
6
44
  super([cooktop, powerSource], { uniqueStorageKey: `${name.replaceAll(' ', '')}-${serial.replaceAll(' ', '')}` }, true);
7
45
  this.createDefaultIdentifyClusterServer();
@@ -10,6 +48,22 @@ export class Cooktop extends MatterbridgeEndpoint {
10
48
  this.createOffOnlyOnOffClusterServer(true);
11
49
  this.addFixedLabel('composed', 'Cooktop');
12
50
  }
51
+ /**
52
+ * Adds a surface to the cooktop.
53
+ *
54
+ * @param {string} name - The name of the surface.
55
+ * @param {Semtag[]} tagList - The tagList associated with the surface.
56
+ * @param {number} selectedTemperatureLevel - The selected temperature level as an index of the supportedTemperatureLevels array. Defaults to 2 (which corresponds to 'Level 3').
57
+ * @param {string[]} supportedTemperatureLevels - The list of supported temperature levels for the surface. Defaults to ['Level 1', 'Level 2', 'Level 3', 'Level 4', 'Level 5'].
58
+ *
59
+ * @returns {MatterbridgeEndpoint} The MatterbridgeEndpoint instance representing the surface.
60
+ *
61
+ * @remarks
62
+ * 13.7 A Cook Surface device type represents a heating object on a cooktop or other similar device. It
63
+ * SHALL only be used when composed as part of another device type.
64
+ *
65
+ * The OnOff cluster is off only mandatory for all Cook Surface devices!
66
+ */
13
67
  addSurface(name, tagList, selectedTemperatureLevel = 2, supportedTemperatureLevels = ['Level 1', 'Level 2', 'Level 3', 'Level 4', 'Level 5']) {
14
68
  const surface = this.addChildDeviceType(name, cookSurface, { tagList }, true);
15
69
  surface.log.logName = name;
@@ -19,3 +73,4 @@ export class Cooktop extends MatterbridgeEndpoint {
19
73
  return surface;
20
74
  }
21
75
  }
76
+ //# sourceMappingURL=cooktop.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cooktop.js","sourceRoot":"","sources":["../../src/devices/cooktop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,EAAE,0CAA0C,EAAE,MAAM,yBAAyB,CAAC;AAErF,MAAM,OAAO,OAAQ,SAAQ,oBAAoB;IAC/C;;;;;;;;;;;;;;OAcG;IACH,YAAY,IAAY,EAAE,MAAc;QACtC,KAAK,CAAC,CAAC,OAAO,EAAE,WAAW,CAAC,EAAE,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;QACvH,IAAI,CAAC,kCAAkC,EAAE,CAAC;QAC1C,IAAI,CAAC,0CAA0C,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;QACzG,IAAI,CAAC,0CAA0C,EAAE,CAAC;QAClD,IAAI,CAAC,+BAA+B,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IAC5C,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,UAAU,CAAC,IAAY,EAAE,OAAiB,EAAE,2BAAmC,CAAC,EAAE,6BAAuC,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC;QAC9K,MAAM,OAAO,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,CAAC,CAAC;QAC9E,OAAO,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC;QAC3B,0CAA0C,CAAC,OAAO,EAAE,wBAAwB,EAAE,0BAA0B,CAAC,CAAC;QAC1G,OAAO,CAAC,gDAAgD,CAAC,IAAI,CAAC,CAAC;QAC/D,OAAO,CAAC,+BAA+B,CAAC,IAAI,CAAC,CAAC;QAC9C,OAAO,OAAO,CAAC;IACjB,CAAC;CACF"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * @description This file contains the Dishwasher class.
3
+ * @file src/devices/dishwasher.ts
4
+ * @author Luca Liguori
5
+ * @created 2025-05-25
6
+ * @version 1.1.0
7
+ * @license Apache-2.0
8
+ *
9
+ * Copyright 2025, 2026, 2027 Luca Liguori.
10
+ *
11
+ * Licensed under the Apache License, Version 2.0 (the "License");
12
+ * you may not use this file except in compliance with the License.
13
+ * You may obtain a copy of the License at
14
+ *
15
+ * http://www.apache.org/licenses/LICENSE-2.0
16
+ *
17
+ * Unless required by applicable law or agreed to in writing, software
18
+ * distributed under the License is distributed on an "AS IS" BASIS,
19
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
+ * See the License for the specific language governing permissions and
21
+ * limitations under the License.
22
+ */
23
+ import { MaybePromise } from '@matter/main';
24
+ import { OperationalState } from '@matter/main/clusters/operational-state';
25
+ import { ModeBase } from '@matter/main/clusters/mode-base';
26
+ import { DishwasherModeServer } from '@matter/main/behaviors/dishwasher-mode';
27
+ import { DishwasherMode } from '@matter/main/clusters/dishwasher-mode';
28
+ import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
29
+ export declare class Dishwasher extends MatterbridgeEndpoint {
30
+ /**
31
+ * Creates an instance of the DishWasher class.
32
+ *
33
+ * @param {string} name - The name of the dish washer.
34
+ * @param {string} serial - The serial number of the dish washer.
35
+ * @param {number} [currentMode] - The current mode of the dish washer. Defaults to 2 (Normal mode). Dead Front OnOff Cluster will set this to 2 when turned off. Persistent attribute.
36
+ * @param {DishwasherMode.ModeOption[]} [supportedModes] - The supported modes of the dish washer. Defaults to a set of common modes (which include Light, Normal, Heavy). Fixed attribute.
37
+ * @param {number} [selectedTemperatureLevel] - The selected temperature level as an index of the supportedTemperatureLevels array. Defaults to 1 (which corresponds to 'Warm').
38
+ * @param {string[]} [supportedTemperatureLevels] - The supported temperature levels. Defaults to ['Cold', 'Warm', 'Hot', '30°', '40°', '60°', '80°']. Fixed attribute.
39
+ * @param {number} [temperatureSetpoint] - The temperature setpoint * 100. Defaults to 40 * 100 (which corresponds to 40°C).
40
+ * @param {number} [minTemperature] - The minimum temperature * 100. Defaults to 30 * 100 (which corresponds to 30°C). Fixed attribute.
41
+ * @param {number} [maxTemperature] - The maximum temperature * 100. Defaults to 60 * 100 (which corresponds to 60°C). Fixed attribute.
42
+ * @param {number} [step] - The step size for temperature changes. Defaults to 10 * 100 (which corresponds to 10°C). Fixed attribute.
43
+ * @param {OperationalState.OperationalStateEnum} [operationalState] - The operational state of the laundry washer. Defaults to OperationalState.OperationalStateEnum.Off.
44
+ *
45
+ * Remarks:
46
+ * - If `temperatureSetpoint` is provided, the `createNumberTemperatureControlClusterServer` method will be used to create the TemperatureControl Cluster Server with features TemperatureNumber and TemperatureStep.
47
+ * - If `temperatureSetpoint` is not provided, the `createLevelTemperatureControlClusterServer` method will be used to create the TemperatureControl Cluster Server with feature TemperatureLevel.
48
+ */
49
+ constructor(name: string, serial: string, currentMode?: number, supportedModes?: DishwasherMode.ModeOption[], selectedTemperatureLevel?: number, supportedTemperatureLevels?: string[], temperatureSetpoint?: number, minTemperature?: number, maxTemperature?: number, step?: number, operationalState?: OperationalState.OperationalStateEnum);
50
+ /**
51
+ * Creates a default Dishwasher Mode Cluster Server.
52
+ *
53
+ * @param {number} currentMode - The current mode of the dishwasher. Persistent attribute.
54
+ * @param {DishwasherMode.ModeOption[]} supportedModes - The supported modes of the dishwasher. Defaults to a set of common modes (Light, Normal, Heavy). Fixed attribute.
55
+ *
56
+ * @returns {this} The current MatterbridgeEndpoint instance for chaining.
57
+ */
58
+ createDefaultDishwasherModeClusterServer(currentMode?: number, supportedModes?: DishwasherMode.ModeOption[]): this;
59
+ /**
60
+ * Creates a default Dishwasher Alarm Cluster Server.
61
+ *
62
+ * @returns {this} The current MatterbridgeEndpoint instance for chaining.
63
+ */
64
+ createDefaultDishwasherAlarmClusterServer(): this;
65
+ }
66
+ export declare class MatterbridgeDishwasherModeServer extends DishwasherModeServer {
67
+ initialize(): void;
68
+ protected handleOnOffChange(onOff: boolean): void;
69
+ changeToMode(request: ModeBase.ChangeToModeRequest): MaybePromise<ModeBase.ChangeToModeResponse>;
70
+ }
71
+ //# sourceMappingURL=dishwasher.d.ts.map
@@ -0,0 +1 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C;CAc1G"}
@@ -1,12 +1,54 @@
1
+ /**
2
+ * @description This file contains the Dishwasher class.
3
+ * @file src/devices/dishwasher.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 { DishwasherModeServer } from '@matter/main/behaviors/dishwasher-mode';
3
25
  import { DishwasherAlarmServer } from '@matter/main/behaviors/dishwasher-alarm';
4
26
  import { DishwasherMode } from '@matter/main/clusters/dishwasher-mode';
27
+ // Matterbridge
5
28
  import { dishwasher, powerSource } from '../matterbridgeDeviceTypes.js';
6
29
  import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
7
30
  import { MatterbridgeOnOffServer, MatterbridgeServer } from '../matterbridgeBehaviors.js';
8
31
  import { createLevelTemperatureControlClusterServer, createNumberTemperatureControlClusterServer } from './temperatureControl.js';
9
32
  export class Dishwasher extends MatterbridgeEndpoint {
33
+ /**
34
+ * Creates an instance of the DishWasher class.
35
+ *
36
+ * @param {string} name - The name of the dish washer.
37
+ * @param {string} serial - The serial number of the dish washer.
38
+ * @param {number} [currentMode] - The current mode of the dish washer. Defaults to 2 (Normal mode). Dead Front OnOff Cluster will set this to 2 when turned off. Persistent attribute.
39
+ * @param {DishwasherMode.ModeOption[]} [supportedModes] - The supported modes of the dish washer. Defaults to a set of common modes (which include Light, Normal, Heavy). Fixed attribute.
40
+ * @param {number} [selectedTemperatureLevel] - The selected temperature level as an index of the supportedTemperatureLevels array. Defaults to 1 (which corresponds to 'Warm').
41
+ * @param {string[]} [supportedTemperatureLevels] - The supported temperature levels. Defaults to ['Cold', 'Warm', 'Hot', '30°', '40°', '60°', '80°']. Fixed attribute.
42
+ * @param {number} [temperatureSetpoint] - The temperature setpoint * 100. Defaults to 40 * 100 (which corresponds to 40°C).
43
+ * @param {number} [minTemperature] - The minimum temperature * 100. Defaults to 30 * 100 (which corresponds to 30°C). Fixed attribute.
44
+ * @param {number} [maxTemperature] - The maximum temperature * 100. Defaults to 60 * 100 (which corresponds to 60°C). Fixed attribute.
45
+ * @param {number} [step] - The step size for temperature changes. Defaults to 10 * 100 (which corresponds to 10°C). Fixed attribute.
46
+ * @param {OperationalState.OperationalStateEnum} [operationalState] - The operational state of the laundry washer. Defaults to OperationalState.OperationalStateEnum.Off.
47
+ *
48
+ * Remarks:
49
+ * - If `temperatureSetpoint` is provided, the `createNumberTemperatureControlClusterServer` method will be used to create the TemperatureControl Cluster Server with features TemperatureNumber and TemperatureStep.
50
+ * - If `temperatureSetpoint` is not provided, the `createLevelTemperatureControlClusterServer` method will be used to create the TemperatureControl Cluster Server with feature TemperatureLevel.
51
+ */
10
52
  constructor(name, serial, currentMode, supportedModes, selectedTemperatureLevel, supportedTemperatureLevels, temperatureSetpoint, minTemperature, maxTemperature, step, operationalState) {
11
53
  super([dishwasher, powerSource], { uniqueStorageKey: `${name.replaceAll(' ', '')}-${serial.replaceAll(' ', '')}` }, true);
12
54
  this.createDefaultIdentifyClusterServer();
@@ -21,6 +63,14 @@ export class Dishwasher extends MatterbridgeEndpoint {
21
63
  createLevelTemperatureControlClusterServer(this, selectedTemperatureLevel, supportedTemperatureLevels);
22
64
  this.createDefaultOperationalStateClusterServer(operationalState);
23
65
  }
66
+ /**
67
+ * Creates a default Dishwasher Mode Cluster Server.
68
+ *
69
+ * @param {number} currentMode - The current mode of the dishwasher. Persistent attribute.
70
+ * @param {DishwasherMode.ModeOption[]} supportedModes - The supported modes of the dishwasher. Defaults to a set of common modes (Light, Normal, Heavy). Fixed attribute.
71
+ *
72
+ * @returns {this} The current MatterbridgeEndpoint instance for chaining.
73
+ */
24
74
  createDefaultDishwasherModeClusterServer(currentMode = 2, supportedModes = [
25
75
  { label: 'Light', mode: 1, modeTags: [{ value: DishwasherMode.ModeTag.Light }] },
26
76
  { label: 'Normal', mode: 2, modeTags: [{ value: DishwasherMode.ModeTag.Normal }] },
@@ -32,6 +82,11 @@ export class Dishwasher extends MatterbridgeEndpoint {
32
82
  });
33
83
  return this;
34
84
  }
85
+ /**
86
+ * Creates a default Dishwasher Alarm Cluster Server.
87
+ *
88
+ * @returns {this} The current MatterbridgeEndpoint instance for chaining.
89
+ */
35
90
  createDefaultDishwasherAlarmClusterServer() {
36
91
  this.behaviors.require(DishwasherAlarmServer, {
37
92
  mask: { inflowError: true, drainError: true, doorError: true, tempTooLow: true, tempTooHigh: true, waterLevelError: true },
@@ -48,6 +103,7 @@ export class MatterbridgeDishwasherModeServer extends DishwasherModeServer {
48
103
  this.state.currentMode = 2;
49
104
  this.reactTo(this.agent.get(MatterbridgeOnOffServer).events.onOff$Changed, this.handleOnOffChange);
50
105
  }
106
+ // Dead Front OnOff Cluster
51
107
  handleOnOffChange(onOff) {
52
108
  const device = this.endpoint.stateOf(MatterbridgeServer);
53
109
  if (onOff === false) {
@@ -71,3 +127,4 @@ export class MatterbridgeDishwasherModeServer extends DishwasherModeServer {
71
127
  }
72
128
  }
73
129
  }
130
+ //# sourceMappingURL=dishwasher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dishwasher.js","sourceRoot":"","sources":["../../src/devices/dishwasher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,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,CAAC,cAAc,CAAC,cAAc,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,oBAAoB,CAAC,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QACrJ,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;QAChH,IAAI,aAAa,EAAE,CAAC;YAClB,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,uDAAuD,aAAa,CAAC,IAAI,OAAO,aAAa,CAAC,KAAK,EAAE,CAAC,CAAC;YACvH,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;YACzC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC;QAC9E,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,+DAA+D,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;YACnG,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,gBAAgB,CAAC,aAAa,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC;QACzF,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * @description This file contains the Evse class.
3
+ * @file src/devices/energy-evse.ts
4
+ * @author Luca Liguori
5
+ * @contributor Ludovic BOUÉ
6
+ * @created 2025-05-27
7
+ * @version 1.1.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 { MaybePromise } from '@matter/main';
25
+ import { EnergyEvseServer } from '@matter/main/behaviors/energy-evse';
26
+ import { EnergyEvseModeServer } from '@matter/main/behaviors/energy-evse-mode';
27
+ import { EnergyEvse, EnergyEvseMode } from '@matter/main/clusters';
28
+ import { ModeBase } from '@matter/main/clusters/mode-base';
29
+ import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
30
+ export declare class Evse extends MatterbridgeEndpoint {
31
+ /**
32
+ * Creates an instance of the EVSE class.
33
+ *
34
+ * @param {string} name - The name of the EVSE.
35
+ * @param {string} serial - The serial number of the EVSE.
36
+ * @param {number} [currentMode] - The current mode of the EnergyEvseMode cluster. Defaults to mode 1 (EnergyEvseMode.ModeTag.Manual).
37
+ * @param {EnergyEvseMode.ModeOption[]} [supportedModes] - The supported modes for the EnergyEvseMode cluster. This is a fixed attribute that defaults to a predefined set of EnergyEvseMode cluster modes.
38
+ * @param {EnergyEvse.State} [state] - The current state of the EVSE. Defaults to NotPluggedIn.
39
+ * @param {EnergyEvse.SupplyState} [supplyState] - The supply state of the EVSE. Defaults to Disabled.
40
+ * @param {EnergyEvse.FaultState} [faultState] - The fault state of the EVSE. Defaults to NoError.
41
+ * @param {number} [voltage] - The voltage value in millivolts. Defaults to null if not provided.
42
+ * @param {number} [current] - The current value in milliamperes. Defaults to null if not provided.
43
+ * @param {number} [power] - The power value in milliwatts. Defaults to null if not provided.
44
+ * @param {number} [energy] - The total consumption value in mW/h. Defaults to null if not provided.
45
+ * @param {number} [absMinPower] - Indicate the minimum electrical power in mw that the ESA can consume when switched on. Defaults to `0` if not provided.
46
+ * @param {number} [absMaxPower] - Indicate the maximum electrical power in mw that the ESA can consume when switched on. Defaults to `0` if not provided.
47
+ */
48
+ constructor(name: string, serial: string, currentMode?: number, supportedModes?: EnergyEvseMode.ModeOption[], state?: EnergyEvse.State, supplyState?: EnergyEvse.SupplyState, faultState?: EnergyEvse.FaultState, voltage?: number | bigint | null, current?: number | bigint | null, power?: number | bigint | null, energy?: number | bigint | null, absMinPower?: number, absMaxPower?: number);
49
+ /**
50
+ * Creates a default EnergyEvseServer Cluster Server.
51
+ *
52
+ * @param {EnergyEvse.State} [state] - The initial state of the EnergyEvse cluster. Defaults to EnergyEvse.State.NotPluggedIn.
53
+ * @param {EnergyEvse.SupplyState} [supplyState] - The initial supply state of the EnergyEvse cluster. Defaults to EnergyEvse.SupplyState.ChargingEnabled.
54
+ * @param {EnergyEvse.FaultState} [faultState] - The initial fault state of the EnergyEvse cluster. Defaults to EnergyEvse.FaultState.NoError.
55
+ * @returns {this} The current MatterbridgeEndpoint instance for chaining.
56
+ */
57
+ createDefaultEnergyEvseClusterServer(state?: EnergyEvse.State, supplyState?: EnergyEvse.SupplyState, faultState?: EnergyEvse.FaultState): this;
58
+ /**
59
+ * Creates a default EnergyEvseMode Cluster Server.
60
+ *
61
+ * @param {number} [currentMode] - The current mode of the EnergyEvseMode cluster. Defaults to mode 1 (EnergyEvseMode.ModeTag.Manual).
62
+ * @param {EnergyEvseMode.ModeOption[]} [supportedModes] - The supported modes for the EnergyEvseMode cluster. Defaults all EnergyEvseMode cluster modes.
63
+ *
64
+ * @returns {this} The current MatterbridgeEndpoint instance for chaining.
65
+ */
66
+ createDefaultEnergyEvseModeClusterServer(currentMode?: number, supportedModes?: EnergyEvseMode.ModeOption[]): this;
67
+ }
68
+ export declare class MatterbridgeEnergyEvseServer extends EnergyEvseServer {
69
+ disable(): MaybePromise;
70
+ enableCharging(request: EnergyEvse.EnableChargingRequest): MaybePromise;
71
+ }
72
+ export declare class MatterbridgeEnergyEvseModeServer extends EnergyEvseModeServer {
73
+ changeToMode(request: ModeBase.ChangeToModeRequest): MaybePromise<ModeBase.ChangeToModeResponse>;
74
+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