matterbridge 3.1.0 → 3.1.1-dev-20250629-f14b886

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 (188) hide show
  1. package/CHANGELOG.md +17 -4
  2. package/README-DEV.md +14 -2
  3. package/dist/cli.js +2 -91
  4. package/dist/clusters/export.js +0 -2
  5. package/dist/defaultConfigSchema.js +0 -24
  6. package/dist/deviceManager.js +1 -94
  7. package/dist/devices/export.js +0 -2
  8. package/dist/evse.js +9 -70
  9. package/dist/frontend.js +16 -413
  10. package/dist/globalMatterbridge.js +0 -47
  11. package/dist/helpers.js +0 -53
  12. package/dist/index.js +1 -32
  13. package/dist/laundryWasher.js +7 -92
  14. package/dist/logger/export.js +0 -1
  15. package/dist/matter/behaviors.js +0 -2
  16. package/dist/matter/clusters.js +0 -2
  17. package/dist/matter/devices.js +0 -2
  18. package/dist/matter/endpoints.js +0 -2
  19. package/dist/matter/export.js +0 -3
  20. package/dist/matter/types.js +0 -3
  21. package/dist/matterbridge.js +50 -797
  22. package/dist/matterbridgeAccessoryPlatform.js +0 -36
  23. package/dist/matterbridgeBehaviors.js +1 -55
  24. package/dist/matterbridgeDeviceTypes.js +15 -579
  25. package/dist/matterbridgeDynamicPlatform.js +0 -36
  26. package/dist/matterbridgeEndpoint.js +40 -1022
  27. package/dist/matterbridgeEndpointHelpers.js +12 -322
  28. package/dist/matterbridgePlatform.js +0 -233
  29. package/dist/matterbridgeTypes.js +0 -25
  30. package/dist/pluginManager.js +3 -269
  31. package/dist/roboticVacuumCleaner.js +6 -83
  32. package/dist/shelly.js +7 -168
  33. package/dist/storage/export.js +0 -1
  34. package/dist/update.js +0 -54
  35. package/dist/utils/colorUtils.js +2 -263
  36. package/dist/utils/commandLine.js +0 -54
  37. package/dist/utils/copyDirectory.js +1 -38
  38. package/dist/utils/createDirectory.js +0 -33
  39. package/dist/utils/createZip.js +2 -47
  40. package/dist/utils/deepCopy.js +0 -39
  41. package/dist/utils/deepEqual.js +1 -72
  42. package/dist/utils/export.js +0 -1
  43. package/dist/utils/hex.js +0 -58
  44. package/dist/utils/isvalid.js +0 -101
  45. package/dist/utils/network.js +5 -83
  46. package/dist/utils/spawn.js +0 -18
  47. package/dist/utils/wait.js +9 -62
  48. package/dist/waterHeater.js +2 -77
  49. package/npm-shrinkwrap.json +2 -2
  50. package/package.json +1 -2
  51. package/dist/cli.d.ts +0 -29
  52. package/dist/cli.d.ts.map +0 -1
  53. package/dist/cli.js.map +0 -1
  54. package/dist/clusters/export.d.ts +0 -2
  55. package/dist/clusters/export.d.ts.map +0 -1
  56. package/dist/clusters/export.js.map +0 -1
  57. package/dist/defaultConfigSchema.d.ts +0 -28
  58. package/dist/defaultConfigSchema.d.ts.map +0 -1
  59. package/dist/defaultConfigSchema.js.map +0 -1
  60. package/dist/deviceManager.d.ts +0 -112
  61. package/dist/deviceManager.d.ts.map +0 -1
  62. package/dist/deviceManager.js.map +0 -1
  63. package/dist/devices/export.d.ts +0 -5
  64. package/dist/devices/export.d.ts.map +0 -1
  65. package/dist/devices/export.js.map +0 -1
  66. package/dist/evse.d.ts +0 -72
  67. package/dist/evse.d.ts.map +0 -1
  68. package/dist/evse.js.map +0 -1
  69. package/dist/frontend.d.ts +0 -285
  70. package/dist/frontend.d.ts.map +0 -1
  71. package/dist/frontend.js.map +0 -1
  72. package/dist/globalMatterbridge.d.ts +0 -59
  73. package/dist/globalMatterbridge.d.ts.map +0 -1
  74. package/dist/globalMatterbridge.js.map +0 -1
  75. package/dist/helpers.d.ts +0 -48
  76. package/dist/helpers.d.ts.map +0 -1
  77. package/dist/helpers.js.map +0 -1
  78. package/dist/index.d.ts +0 -38
  79. package/dist/index.d.ts.map +0 -1
  80. package/dist/index.js.map +0 -1
  81. package/dist/laundryWasher.d.ts +0 -243
  82. package/dist/laundryWasher.d.ts.map +0 -1
  83. package/dist/laundryWasher.js.map +0 -1
  84. package/dist/logger/export.d.ts +0 -2
  85. package/dist/logger/export.d.ts.map +0 -1
  86. package/dist/logger/export.js.map +0 -1
  87. package/dist/matter/behaviors.d.ts +0 -2
  88. package/dist/matter/behaviors.d.ts.map +0 -1
  89. package/dist/matter/behaviors.js.map +0 -1
  90. package/dist/matter/clusters.d.ts +0 -2
  91. package/dist/matter/clusters.d.ts.map +0 -1
  92. package/dist/matter/clusters.js.map +0 -1
  93. package/dist/matter/devices.d.ts +0 -2
  94. package/dist/matter/devices.d.ts.map +0 -1
  95. package/dist/matter/devices.js.map +0 -1
  96. package/dist/matter/endpoints.d.ts +0 -2
  97. package/dist/matter/endpoints.d.ts.map +0 -1
  98. package/dist/matter/endpoints.js.map +0 -1
  99. package/dist/matter/export.d.ts +0 -5
  100. package/dist/matter/export.d.ts.map +0 -1
  101. package/dist/matter/export.js.map +0 -1
  102. package/dist/matter/types.d.ts +0 -3
  103. package/dist/matter/types.d.ts.map +0 -1
  104. package/dist/matter/types.js.map +0 -1
  105. package/dist/matterbridge.d.ts +0 -450
  106. package/dist/matterbridge.d.ts.map +0 -1
  107. package/dist/matterbridge.js.map +0 -1
  108. package/dist/matterbridgeAccessoryPlatform.d.ts +0 -42
  109. package/dist/matterbridgeAccessoryPlatform.d.ts.map +0 -1
  110. package/dist/matterbridgeAccessoryPlatform.js.map +0 -1
  111. package/dist/matterbridgeBehaviors.d.ts +0 -1334
  112. package/dist/matterbridgeBehaviors.d.ts.map +0 -1
  113. package/dist/matterbridgeBehaviors.js.map +0 -1
  114. package/dist/matterbridgeDeviceTypes.d.ts +0 -709
  115. package/dist/matterbridgeDeviceTypes.d.ts.map +0 -1
  116. package/dist/matterbridgeDeviceTypes.js.map +0 -1
  117. package/dist/matterbridgeDynamicPlatform.d.ts +0 -42
  118. package/dist/matterbridgeDynamicPlatform.d.ts.map +0 -1
  119. package/dist/matterbridgeDynamicPlatform.js.map +0 -1
  120. package/dist/matterbridgeEndpoint.d.ts +0 -1173
  121. package/dist/matterbridgeEndpoint.d.ts.map +0 -1
  122. package/dist/matterbridgeEndpoint.js.map +0 -1
  123. package/dist/matterbridgeEndpointHelpers.d.ts +0 -3198
  124. package/dist/matterbridgeEndpointHelpers.d.ts.map +0 -1
  125. package/dist/matterbridgeEndpointHelpers.js.map +0 -1
  126. package/dist/matterbridgePlatform.d.ts +0 -310
  127. package/dist/matterbridgePlatform.d.ts.map +0 -1
  128. package/dist/matterbridgePlatform.js.map +0 -1
  129. package/dist/matterbridgeTypes.d.ts +0 -184
  130. package/dist/matterbridgeTypes.d.ts.map +0 -1
  131. package/dist/matterbridgeTypes.js.map +0 -1
  132. package/dist/pluginManager.d.ts +0 -291
  133. package/dist/pluginManager.d.ts.map +0 -1
  134. package/dist/pluginManager.js.map +0 -1
  135. package/dist/roboticVacuumCleaner.d.ts +0 -104
  136. package/dist/roboticVacuumCleaner.d.ts.map +0 -1
  137. package/dist/roboticVacuumCleaner.js.map +0 -1
  138. package/dist/shelly.d.ts +0 -174
  139. package/dist/shelly.d.ts.map +0 -1
  140. package/dist/shelly.js.map +0 -1
  141. package/dist/storage/export.d.ts +0 -2
  142. package/dist/storage/export.d.ts.map +0 -1
  143. package/dist/storage/export.js.map +0 -1
  144. package/dist/update.d.ts +0 -59
  145. package/dist/update.d.ts.map +0 -1
  146. package/dist/update.js.map +0 -1
  147. package/dist/utils/colorUtils.d.ts +0 -117
  148. package/dist/utils/colorUtils.d.ts.map +0 -1
  149. package/dist/utils/colorUtils.js.map +0 -1
  150. package/dist/utils/commandLine.d.ts +0 -59
  151. package/dist/utils/commandLine.d.ts.map +0 -1
  152. package/dist/utils/commandLine.js.map +0 -1
  153. package/dist/utils/copyDirectory.d.ts +0 -33
  154. package/dist/utils/copyDirectory.d.ts.map +0 -1
  155. package/dist/utils/copyDirectory.js.map +0 -1
  156. package/dist/utils/createDirectory.d.ts +0 -34
  157. package/dist/utils/createDirectory.d.ts.map +0 -1
  158. package/dist/utils/createDirectory.js.map +0 -1
  159. package/dist/utils/createZip.d.ts +0 -39
  160. package/dist/utils/createZip.d.ts.map +0 -1
  161. package/dist/utils/createZip.js.map +0 -1
  162. package/dist/utils/deepCopy.d.ts +0 -32
  163. package/dist/utils/deepCopy.d.ts.map +0 -1
  164. package/dist/utils/deepCopy.js.map +0 -1
  165. package/dist/utils/deepEqual.d.ts +0 -54
  166. package/dist/utils/deepEqual.d.ts.map +0 -1
  167. package/dist/utils/deepEqual.js.map +0 -1
  168. package/dist/utils/export.d.ts +0 -12
  169. package/dist/utils/export.d.ts.map +0 -1
  170. package/dist/utils/export.js.map +0 -1
  171. package/dist/utils/hex.d.ts +0 -49
  172. package/dist/utils/hex.d.ts.map +0 -1
  173. package/dist/utils/hex.js.map +0 -1
  174. package/dist/utils/isvalid.d.ts +0 -103
  175. package/dist/utils/isvalid.d.ts.map +0 -1
  176. package/dist/utils/isvalid.js.map +0 -1
  177. package/dist/utils/network.d.ts +0 -76
  178. package/dist/utils/network.d.ts.map +0 -1
  179. package/dist/utils/network.js.map +0 -1
  180. package/dist/utils/spawn.d.ts +0 -14
  181. package/dist/utils/spawn.d.ts.map +0 -1
  182. package/dist/utils/spawn.js.map +0 -1
  183. package/dist/utils/wait.d.ts +0 -56
  184. package/dist/utils/wait.d.ts.map +0 -1
  185. package/dist/utils/wait.js.map +0 -1
  186. package/dist/waterHeater.d.ts +0 -106
  187. package/dist/waterHeater.d.ts.map +0 -1
  188. package/dist/waterHeater.js.map +0 -1
@@ -1,70 +1,23 @@
1
- /**
2
- * This file contains functions to set and get global instances of Matterbridge, Frontend, and Logger.
3
- *
4
- * @file globalMatterbridge.ts
5
- * @author Luca Liguori
6
- * @created 2025-06-01
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
- /**
25
- * Store the Matterbridge instance globally for later retrieval.
26
- *
27
- * @param {Matterbridge} matterbridge An initialized Matterbridge instance
28
- */
29
1
  export function setGlobalMatterbridge(matterbridge) {
30
2
  globalThis.__matterbridge__ = matterbridge;
31
3
  globalThis.__frontend__ = matterbridge.frontend;
32
4
  globalThis.__log__ = matterbridge.log;
33
5
  }
34
- /**
35
- * Retrieve the globally stored Matterbridge instance.
36
- *
37
- * @returns {Matterbridge} The Matterbridge instance.
38
- * @throws {Error} If the Matterbridge instance is not set.
39
- */
40
6
  export function getGlobalMatterbridge() {
41
7
  if (!globalThis.__matterbridge__) {
42
8
  throw new Error('Global Matterbridge instance is not set.');
43
9
  }
44
10
  return globalThis.__matterbridge__;
45
11
  }
46
- /**
47
- * Retrieve the globally stored Frontend instance.
48
- *
49
- * @returns {Frontend} The Frontend instance.
50
- * @throws {Error} If the Frontend instance is not set.
51
- */
52
12
  export function getGlobalFrontend() {
53
13
  if (!globalThis.__frontend__) {
54
14
  throw new Error('Global Frontend instance is not set.');
55
15
  }
56
16
  return globalThis.__frontend__;
57
17
  }
58
- /**
59
- * Retrieve the globally stored Logger instance.
60
- *
61
- * @returns {AnsiLogger} The AnsiLogger instance.
62
- * @throws {Error} If the Logger instance is not set.
63
- */
64
18
  export function getGlobalLog() {
65
19
  if (!globalThis.__log__) {
66
20
  throw new Error('Global Logger instance is not set.');
67
21
  }
68
22
  return globalThis.__log__;
69
23
  }
70
- //# sourceMappingURL=globalMatterbridge.js.map
package/dist/helpers.js CHANGED
@@ -1,27 +1,3 @@
1
- /**
2
- * This file contains the helpers functions of Matterbridge.
3
- *
4
- * @file helpers.ts
5
- * @author Luca Liguori
6
- * @created 2025-05-12
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 module
25
1
  import { OnOff } from '@matter/main/clusters/on-off';
26
2
  import { Endpoint } from '@matter/node';
27
3
  import { BridgedDeviceBasicInformationServer } from '@matter/node/behaviors/bridged-device-basic-information';
@@ -30,24 +6,8 @@ import { OnOffPlugInUnitDevice } from '@matter/node/devices/on-off-plug-in-unit'
30
6
  import { MountedOnOffControlDevice } from '@matter/node/devices/mounted-on-off-control';
31
7
  import { OnOffLightDevice } from '@matter/node/devices/on-off-light';
32
8
  import { OnOffLightSwitchDevice } from '@matter/node/devices/on-off-light-switch';
33
- // Matterbridge
34
9
  import { hasParameter } from './utils/commandLine.js';
35
- /**
36
- * Adds a virtual device to the provided endpoint, sets up an event listener for device state changes,
37
- * and ensures the device is initialized in the off state.
38
- *
39
- * @param {Endpoint<AggregatorEndpoint>} aggregatorEndpoint - The aggragator endpoint to which the virtual device will be added.
40
- * @param {string} name - The name of the virtual device. Spaces in the name are removed to form the device ID.
41
- * @param {'light' | 'outlet' | 'switch' | 'mounted_switch'} type - The type of the virtual device. Can be 'light', 'outlet', 'switch', or 'mounted_switch'.
42
- * @param {() => Promise<void>} callback - A callback function that gets executed when the device's on/off state changes to true.
43
- * @returns {Promise<Endpoint>} A promise that resolves with the created virtual device.
44
- * @remarks The virtual device is created as an instance of `Endpoint` with the `OnOffPlugInUnitDevice` device type.
45
- * The onOff state always reverts to false when the device is turned on.
46
- */
47
10
  export async function addVirtualDevice(aggregatorEndpoint, name, type, callback) {
48
- // Create a new virtual device by instantiating `Endpoint` with device information.
49
- // The device ID is created by replacing all spaces in the name with an empty string.
50
- // The node label of the bridged device basic information is set to the given name.
51
11
  let deviceType;
52
12
  switch (type) {
53
13
  case 'light':
@@ -68,9 +28,7 @@ export async function addVirtualDevice(aggregatorEndpoint, name, type, callback)
68
28
  bridgedDeviceBasicInformation: { nodeLabel: name.slice(0, 32) },
69
29
  onOff: { onOff: false, startUpOnOff: OnOff.StartUpOnOff.Off },
70
30
  });
71
- // Set up an event listener for when the `onOff` state changes.
72
31
  device.events.onOff.onOff$Changed.on((value) => {
73
- // If the `onOff` state becomes true, turn off the virtual device and execute the callback.
74
32
  if (value) {
75
33
  callback();
76
34
  process.nextTick(async () => {
@@ -78,24 +36,14 @@ export async function addVirtualDevice(aggregatorEndpoint, name, type, callback)
78
36
  await device.setStateOf(OnOffBaseServer, { onOff: false });
79
37
  }
80
38
  catch (_error) {
81
- // Not necessary to handle the error
82
39
  }
83
40
  });
84
41
  }
85
42
  });
86
- // Add the created device to the given endpoint.
87
43
  await aggregatorEndpoint.add(device);
88
- // Initially set the state of the virtual device's `OnOffBaseServer` to false (off).
89
44
  await device.setStateOf(OnOffBaseServer, { onOff: false });
90
45
  return device;
91
46
  }
92
- /**
93
- * Creates and add the virtual devices to the aggregator.
94
- *
95
- * @param {Matterbridge} matterbridge - The Matterbridge instance.
96
- * @param {Endpoint<AggregatorEndpoint>} aggregatorEndpoint - The aggregator node to add the virtual devices to.
97
- * @returns {Promise<void>} A promise that resolves when the virtual devices are added.
98
- */
99
47
  export async function addVirtualDevices(matterbridge, aggregatorEndpoint) {
100
48
  if (matterbridge.matterbridgeInformation.virtualMode !== 'disabled' && matterbridge.bridgeMode === 'bridge' && aggregatorEndpoint) {
101
49
  matterbridge.log.notice(`Creating virtual devices for Matterbridge server node...`);
@@ -144,4 +92,3 @@ export async function addVirtualDevices(matterbridge, aggregatorEndpoint) {
144
92
  }
145
93
  }
146
94
  }
147
- //# sourceMappingURL=helpers.js.map
package/dist/index.js CHANGED
@@ -1,32 +1,6 @@
1
- /**
2
- * This file contains the entry point of Matterbridge.
3
- *
4
- * @file index.ts
5
- * @author Luca Liguori
6
- * @created 2023-12-29
7
- * @version 1.0.7
8
- * @license Apache-2.0
9
- *
10
- * Copyright 2023, 2024, 2025 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
- // AnsiLogger module
25
1
  import { AnsiLogger } from 'node-ansi-logger';
26
- // Matterbridge
27
2
  import { Matterbridge } from './matterbridge.js';
28
3
  import { hasParameter } from './utils/export.js';
29
- // Matterbridge
30
4
  export * from './matterbridge.js';
31
5
  export * from './matterbridgeTypes.js';
32
6
  export * from './matterbridgeEndpoint.js';
@@ -37,15 +11,11 @@ export * from './matterbridgePlatform.js';
37
11
  export * from './matterbridgeAccessoryPlatform.js';
38
12
  export * from './matterbridgeDynamicPlatform.js';
39
13
  export { addVirtualDevice } from './helpers.js';
40
- // Single class device types (these exports will be removed in the next release)
41
14
  export * from './roboticVacuumCleaner.js';
42
15
  export * from './laundryWasher.js';
43
16
  export * from './waterHeater.js';
44
17
  export * from './evse.js';
45
- const log = new AnsiLogger({ logName: 'Main', logTimestampFormat: 4 /* TimestampFormat.TIME_MILLIS */, logLevel: hasParameter('debug') ? "debug" /* LogLevel.DEBUG */ : "info" /* LogLevel.INFO */ });
46
- /**
47
- * Main function to load the Matterbridge instance.
48
- */
18
+ const log = new AnsiLogger({ logName: 'Main', logTimestampFormat: 4, logLevel: hasParameter('debug') ? "debug" : "info" });
49
19
  async function main() {
50
20
  log.debug('***Matterbridge.loadInstance() called');
51
21
  await Matterbridge.loadInstance();
@@ -54,4 +24,3 @@ async function main() {
54
24
  main().catch((error) => {
55
25
  log.error(`Matterbridge.loadInstance() failed with error: ${error instanceof Error ? error.message : error}`);
56
26
  });
57
- //# sourceMappingURL=index.js.map
@@ -1,26 +1,3 @@
1
- /**
2
- * This file contains the LaundryWasher class.
3
- *
4
- * @file laundryWasher.ts
5
- * @author Luca Liguori
6
- * @created 2025-05-25
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
1
  import { LaundryWasherControls } from '@matter/main/clusters/laundry-washer-controls';
25
2
  import { LaundryWasherMode } from '@matter/main/clusters/laundry-washer-mode';
26
3
  import { TemperatureControl } from '@matter/main/clusters/temperature-control';
@@ -28,34 +5,10 @@ import { ModeBase } from '@matter/main/clusters/mode-base';
28
5
  import { TemperatureControlServer } from '@matter/main/behaviors/temperature-control';
29
6
  import { LaundryWasherModeServer } from '@matter/main/behaviors/laundry-washer-mode';
30
7
  import { LaundryWasherControlsServer } from '@matter/main/behaviors/laundry-washer-controls';
31
- // Matterbridge
32
8
  import { laundryWasher } from './matterbridgeDeviceTypes.js';
33
9
  import { MatterbridgeEndpoint } from './matterbridgeEndpoint.js';
34
10
  import { MatterbridgeOnOffServer, MatterbridgeServer } from './matterbridgeBehaviors.js';
35
11
  export class LaundryWasher extends MatterbridgeEndpoint {
36
- /**
37
- * Creates an instance of the LaundryWasher class.
38
- *
39
- * @param {string} name - The name of the laundry washer.
40
- * @param {string} serial - The serial number of the laundry washer.
41
- * @param {number} [currentMode] - The current mode of the laundry washer. Defaults to 2 (Normal mode). Dead Front OnOff Cluster will set this to 2 when turned off. Persistent attribute.
42
- * @param {LaundryWasherMode.ModeOption[]} [supportedModes] - The supported modes of the laundry washer. Defaults to a set of common modes (which include Delicate, Normal, Heavy, and Whites). Fixed attribute.
43
- * @param {number} [spinSpeedCurrent] - The current spin speed as index of the spinSpeeds array. Defaults to 2 (which corresponds to '1200').
44
- * @param {string[]} [spinSpeeds] - The supported spin speeds. Defaults to ['400', '800', '1200', '1600'].
45
- * @param {LaundryWasherControls.NumberOfRinses} [numberOfRinses] - The number of rinses. Defaults to LaundryWasherControls.NumberOfRinses.Normal (which corresponds to 1 rinse).
46
- * @param {LaundryWasherControls.NumberOfRinses[]} [supportedRinses] - The supported rinses. Defaults to [NumberOfRinses.None, NumberOfRinses.Normal, NumberOfRinses.Max, NumberOfRinses.Extra].
47
- * @param {number} [selectedTemperatureLevel] - The selected temperature level as an index of the supportedTemperatureLevels array. Defaults to 1 (which corresponds to 'Warm').
48
- * @param {string[]} [supportedTemperatureLevels] - The supported temperature levels. Defaults to ['Cold', 'Warm', 'Hot', '30°', '40°', '60°', '80°']. Fixed attribute.
49
- * @param {number} [temperatureSetpoint] - The temperature setpoint * 100. Defaults to 40 * 100 (which corresponds to 40°C).
50
- * @param {number} [minTemperature] - The minimum temperature * 100. Defaults to 30 * 100 (which corresponds to 30°C). Fixed attribute.
51
- * @param {number} [maxTemperature] - The maximum temperature * 100. Defaults to 60 * 100 (which corresponds to 60°C). Fixed attribute.
52
- * @param {number} [step] - The step size for temperature changes. Defaults to 10 * 100 (which corresponds to 10°C). Fixed attribute.
53
- * @param {OperationalState.OperationalStateEnum} [operationalState] - The operational state of the laundry washer. Defaults to OperationalState.OperationalStateEnum.Off.
54
- *
55
- * Remarks:
56
- * - If `temperatureSetpoint` is provided, the `createNumberTemperatureControlClusterServer` method will be used to create the TemperatureControl Cluster Server with features TemperatureNumber and TemperatureStep.
57
- * - If `temperatureSetpoint` is not provided, the `createLevelTemperatureControlClusterServer` method will be used to create the TemperatureControl Cluster Server with feature TemperatureLevel.
58
- */
59
12
  constructor(name, serial, currentMode, supportedModes, spinSpeedCurrent, spinSpeeds, numberOfRinses, supportedRinses, selectedTemperatureLevel, supportedTemperatureLevels, temperatureSetpoint, minTemperature, maxTemperature, step, operationalState) {
60
13
  super(laundryWasher, { uniqueStorageKey: `${name.replaceAll(' ', '')}-${serial.replaceAll(' ', '')}` }, true);
61
14
  this.createDefaultIdentifyClusterServer();
@@ -70,14 +23,6 @@ export class LaundryWasher extends MatterbridgeEndpoint {
70
23
  this.createLevelTemperatureControlClusterServer(selectedTemperatureLevel, supportedTemperatureLevels);
71
24
  this.createDefaultOperationalStateClusterServer(operationalState);
72
25
  }
73
- /**
74
- * Creates a default Laundry Washer Mode Cluster Server.
75
- *
76
- * @param {number} currentMode - The current mode of the laundry washer. Defaults to 2 (Normal mode). Dead Front OnOff Cluster will set this to 2 when turned off. Persistent attribute.
77
- * @param {LaundryWasherMode.ModeOption[]} supportedModes - The supported modes of the laundry washer. Defaults to a set of common modes (which include Delicate, Normal, Heavy, and Whites). Fixed attribute.
78
- *
79
- * @returns {this} The current MatterbridgeEndpoint instance for chaining.
80
- */
81
26
  createDefaultLaundryWasherModeClusterServer(currentMode = 2, supportedModes = [
82
27
  { label: 'Delicate', mode: 1, modeTags: [{ value: LaundryWasherMode.ModeTag.Delicate }] },
83
28
  { label: 'Normal', mode: 2, modeTags: [{ value: LaundryWasherMode.ModeTag.Normal }] },
@@ -85,38 +30,20 @@ export class LaundryWasher extends MatterbridgeEndpoint {
85
30
  { label: 'Whites', mode: 4, modeTags: [{ value: LaundryWasherMode.ModeTag.Whites }] },
86
31
  ]) {
87
32
  this.behaviors.require(MatterbridgeLaundryWasherModeServer, {
88
- supportedModes, // Fixed attribute.
89
- currentMode, // Persistent attribute.
33
+ supportedModes,
34
+ currentMode,
90
35
  });
91
36
  return this;
92
37
  }
93
- /**
94
- * Creates a Laundry Washer Controls Cluster Server with feature Spin for selecting the spin speed and feature Rinse for selecting the number of rinses.
95
- *
96
- * @param {number} spinSpeedCurrent - The current spin speed as index of the spinSpeeds array. Default to 2 (which corresponds to '1200').
97
- * @param {string[]} spinSpeeds - The supported spin speeds. Default to ['400', '800', '1200', '1600'].
98
- * @param {LaundryWasherControls.NumberOfRinses} numberOfRinses - The number of rinses. Default to LaundryWasherControls.NumberOfRinses.Normal (which corresponds to 1 rinse).
99
- * @param {LaundryWasherControls.NumberOfRinses[]} supportedRinses - The supported rinses. Default to [NumberOfRinses.None, NumberOfRinses.Normal, NumberOfRinses.Max, NumberOfRinses.Extra].
100
- *
101
- * @returns {this} The current MatterbridgeEndpoint instance for chaining.
102
- */
103
38
  createDefaultLaundryWasherControlsClusterServer(spinSpeedCurrent = 2, spinSpeeds = ['400', '800', '1200', '1600'], numberOfRinses = LaundryWasherControls.NumberOfRinses.Normal, supportedRinses = [LaundryWasherControls.NumberOfRinses.None, LaundryWasherControls.NumberOfRinses.Normal, LaundryWasherControls.NumberOfRinses.Max, LaundryWasherControls.NumberOfRinses.Extra]) {
104
39
  this.behaviors.require(LaundryWasherControlsServer.with(LaundryWasherControls.Feature.Spin, LaundryWasherControls.Feature.Rinse), {
105
40
  spinSpeeds,
106
- spinSpeedCurrent, // Writable and nullable
41
+ spinSpeedCurrent,
107
42
  supportedRinses,
108
- numberOfRinses, // Writable
43
+ numberOfRinses,
109
44
  });
110
45
  return this;
111
46
  }
112
- /**
113
- * Creates a TemperatureControl Cluster Server with feature TemperatureLevel.
114
- *
115
- * @param {number} selectedTemperatureLevel - The selected temperature level as an index of the supportedTemperatureLevels array. Defaults to 1 (which corresponds to 'Warm').
116
- * @param {string[]} supportedTemperatureLevels - The supported temperature levels. Defaults to ['Cold', 'Warm', 'Hot', '30°', '40°', '60°', '80°']. Fixed attribute.
117
- *
118
- * @returns {this} The current MatterbridgeEndpoint instance for chaining.
119
- */
120
47
  createLevelTemperatureControlClusterServer(selectedTemperatureLevel = 1, supportedTemperatureLevels = ['Cold', 'Warm', 'Hot', '30°', '40°', '60°', '80°']) {
121
48
  this.behaviors.require(MatterbridgeLevelTemperatureControlServer.with(TemperatureControl.Feature.TemperatureLevel), {
122
49
  selectedTemperatureLevel,
@@ -124,22 +51,12 @@ export class LaundryWasher extends MatterbridgeEndpoint {
124
51
  });
125
52
  return this;
126
53
  }
127
- /**
128
- * Creates a TemperatureControl Cluster Server with features TemperatureNumber and TemperatureStep.
129
- *
130
- * @param {number} temperatureSetpoint - The temperature setpoint * 100. Defaults to 40 * 100 (which corresponds to 40°C).
131
- * @param {number} minTemperature - The minimum temperature * 100. Defaults to 30 * 100 (which corresponds to 30°C). Fixed attribute.
132
- * @param {number} maxTemperature - The maximum temperature * 100. Defaults to 60 * 100 (which corresponds to 60°C). Fixed attribute.
133
- * @param {number} [step] - The step size for temperature changes. Defaults to 10 * 100 (which corresponds to 10°C). Fixed attribute.
134
- *
135
- * @returns {this} The current MatterbridgeEndpoint instance for chaining.
136
- */
137
54
  createNumberTemperatureControlClusterServer(temperatureSetpoint = 40 * 100, minTemperature = 30 * 100, maxTemperature = 60 * 100, step = 10 * 100) {
138
55
  this.behaviors.require(MatterbridgeNumberTemperatureControlServer.with(TemperatureControl.Feature.TemperatureNumber, TemperatureControl.Feature.TemperatureStep), {
139
56
  temperatureSetpoint,
140
- minTemperature, // Fixed attribute
141
- maxTemperature, // Fixed attribute
142
- step, // Fixed attribute
57
+ minTemperature,
58
+ maxTemperature,
59
+ step,
143
60
  });
144
61
  return this;
145
62
  }
@@ -188,7 +105,6 @@ export class MatterbridgeLaundryWasherModeServer extends LaundryWasherModeServer
188
105
  device.log.info(`MatterbridgeLaundryWasherModeServer initialized: currentMode is ${this.state.currentMode}`);
189
106
  this.reactTo(this.agent.get(MatterbridgeOnOffServer).events.onOff$Changed, this.handleOnOffChange);
190
107
  }
191
- // Dead Front OnOff Cluster
192
108
  handleOnOffChange(onOff) {
193
109
  const device = this.endpoint.stateOf(MatterbridgeServer);
194
110
  device.log.info(`HandleOnOffChange (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
@@ -213,4 +129,3 @@ export class MatterbridgeLaundryWasherModeServer extends LaundryWasherModeServer
213
129
  }
214
130
  }
215
131
  }
216
- //# sourceMappingURL=laundryWasher.js.map
@@ -1,2 +1 @@
1
1
  export * from 'node-ansi-logger';
2
- //# sourceMappingURL=export.js.map
@@ -1,3 +1 @@
1
- // @matter
2
1
  export * from '@matter/node/behaviors';
3
- //# sourceMappingURL=behaviors.js.map
@@ -1,3 +1 @@
1
- // @matter
2
1
  export * from '@matter/types/clusters';
3
- //# sourceMappingURL=clusters.js.map
@@ -1,3 +1 @@
1
- // @matter
2
1
  export * from '@matter/node/devices';
3
- //# sourceMappingURL=devices.js.map
@@ -1,3 +1 @@
1
- // @matter
2
1
  export { AggregatorEndpoint, ElectricalSensorEndpoint, PowerSourceEndpoint, BridgedNodeEndpoint, RootEndpoint, DeviceEnergyManagementEndpoint, OtaProviderEndpoint, OtaRequestorEndpoint } from '@matter/node/endpoints';
3
- //# sourceMappingURL=endpoints.js.map
@@ -1,7 +1,4 @@
1
- /* eslint-disable import/export */
2
- // @matter
3
1
  export * from '@matter/main';
4
2
  export { SemanticNamespace, ClosureTag, CompassDirectionTag, CompassLocationTag, DirectionTag, ElectricalMeasurementTag, LaundryTag, LevelTag, LocationTag, NumberTag, PositionTag, PowerSourceTag, RefrigeratorTag, RoomAirConditionerTag, SwitchesTag, } from '@matter/main';
5
3
  export { AttributeElement, ClusterElement, ClusterModel, CommandElement, EventElement, FieldElement } from '@matter/main/model';
6
4
  export { MdnsService, Val } from '@matter/main/protocol';
7
- //# sourceMappingURL=export.js.map
@@ -1,5 +1,2 @@
1
- /* eslint-disable import/export */
2
- // @matter
3
1
  export * from '@matter/types';
4
2
  export { ClusterRegistry } from '@matter/types';
5
- //# sourceMappingURL=types.js.map