matterbridge 3.1.1-dev-20250704-aff5fcb → 3.1.1
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.
- package/CHANGELOG.md +4 -3
- package/README.md +5 -25
- package/dist/cli.d.ts +26 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +93 -6
- package/dist/cli.js.map +1 -0
- package/dist/cliEmitter.d.ts +34 -0
- package/dist/cliEmitter.d.ts.map +1 -0
- package/dist/cliEmitter.js +36 -0
- package/dist/cliEmitter.js.map +1 -0
- package/dist/clusters/export.d.ts +2 -0
- package/dist/clusters/export.d.ts.map +1 -0
- package/dist/clusters/export.js +2 -0
- package/dist/clusters/export.js.map +1 -0
- package/dist/defaultConfigSchema.d.ts +28 -0
- package/dist/defaultConfigSchema.d.ts.map +1 -0
- package/dist/defaultConfigSchema.js +24 -0
- package/dist/defaultConfigSchema.js.map +1 -0
- package/dist/deviceManager.d.ts +112 -0
- package/dist/deviceManager.d.ts.map +1 -0
- package/dist/deviceManager.js +94 -1
- package/dist/deviceManager.js.map +1 -0
- package/dist/devices/batteryStorage.d.ts +48 -0
- package/dist/devices/batteryStorage.d.ts.map +1 -0
- package/dist/devices/batteryStorage.js +48 -1
- package/dist/devices/batteryStorage.js.map +1 -0
- package/dist/devices/evse.d.ts +75 -0
- package/dist/devices/evse.d.ts.map +1 -0
- package/dist/devices/evse.js +74 -10
- package/dist/devices/evse.js.map +1 -0
- package/dist/devices/export.d.ts +9 -0
- package/dist/devices/export.d.ts.map +1 -0
- package/dist/devices/export.js +2 -0
- package/dist/devices/export.js.map +1 -0
- package/dist/devices/heatPump.d.ts +47 -0
- package/dist/devices/heatPump.d.ts.map +1 -0
- package/dist/devices/heatPump.js +50 -2
- package/dist/devices/heatPump.js.map +1 -0
- package/dist/devices/laundryDryer.d.ts +87 -0
- package/dist/devices/laundryDryer.d.ts.map +1 -0
- package/dist/devices/laundryDryer.js +83 -6
- package/dist/devices/laundryDryer.js.map +1 -0
- package/dist/devices/laundryWasher.d.ts +242 -0
- package/dist/devices/laundryWasher.d.ts.map +1 -0
- package/dist/devices/laundryWasher.js +91 -7
- package/dist/devices/laundryWasher.js.map +1 -0
- package/dist/devices/roboticVacuumCleaner.d.ts +103 -0
- package/dist/devices/roboticVacuumCleaner.d.ts.map +1 -0
- package/dist/devices/roboticVacuumCleaner.js +82 -6
- package/dist/devices/roboticVacuumCleaner.js.map +1 -0
- package/dist/devices/solarPower.d.ts +40 -0
- package/dist/devices/solarPower.d.ts.map +1 -0
- package/dist/devices/solarPower.js +38 -0
- package/dist/devices/solarPower.js.map +1 -0
- package/dist/devices/waterHeater.d.ts +111 -0
- package/dist/devices/waterHeater.d.ts.map +1 -0
- package/dist/devices/waterHeater.js +82 -2
- package/dist/devices/waterHeater.js.map +1 -0
- package/dist/frontend.d.ts +302 -0
- package/dist/frontend.d.ts.map +1 -0
- package/dist/frontend.js +439 -20
- package/dist/frontend.js.map +1 -0
- package/dist/globalMatterbridge.d.ts +59 -0
- package/dist/globalMatterbridge.d.ts.map +1 -0
- package/dist/globalMatterbridge.js +47 -0
- package/dist/globalMatterbridge.js.map +1 -0
- package/dist/helpers.d.ts +48 -0
- package/dist/helpers.d.ts.map +1 -0
- package/dist/helpers.js +53 -0
- package/dist/helpers.js.map +1 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -1
- package/dist/index.js.map +1 -0
- package/dist/logger/export.d.ts +2 -0
- package/dist/logger/export.d.ts.map +1 -0
- package/dist/logger/export.js +1 -0
- package/dist/logger/export.js.map +1 -0
- package/dist/matter/behaviors.d.ts +2 -0
- package/dist/matter/behaviors.d.ts.map +1 -0
- package/dist/matter/behaviors.js +2 -0
- package/dist/matter/behaviors.js.map +1 -0
- package/dist/matter/clusters.d.ts +2 -0
- package/dist/matter/clusters.d.ts.map +1 -0
- package/dist/matter/clusters.js +2 -0
- package/dist/matter/clusters.js.map +1 -0
- package/dist/matter/devices.d.ts +2 -0
- package/dist/matter/devices.d.ts.map +1 -0
- package/dist/matter/devices.js +2 -0
- package/dist/matter/devices.js.map +1 -0
- package/dist/matter/endpoints.d.ts +2 -0
- package/dist/matter/endpoints.d.ts.map +1 -0
- package/dist/matter/endpoints.js +2 -0
- package/dist/matter/endpoints.js.map +1 -0
- package/dist/matter/export.d.ts +5 -0
- package/dist/matter/export.d.ts.map +1 -0
- package/dist/matter/export.js +3 -0
- package/dist/matter/export.js.map +1 -0
- package/dist/matter/types.d.ts +3 -0
- package/dist/matter/types.d.ts.map +1 -0
- package/dist/matter/types.js +3 -0
- package/dist/matter/types.js.map +1 -0
- package/dist/matterbridge.d.ts +450 -0
- package/dist/matterbridge.d.ts.map +1 -0
- package/dist/matterbridge.js +802 -50
- package/dist/matterbridge.js.map +1 -0
- package/dist/matterbridgeAccessoryPlatform.d.ts +42 -0
- package/dist/matterbridgeAccessoryPlatform.d.ts.map +1 -0
- package/dist/matterbridgeAccessoryPlatform.js +36 -0
- package/dist/matterbridgeAccessoryPlatform.js.map +1 -0
- package/dist/matterbridgeBehaviors.d.ts +1340 -0
- package/dist/matterbridgeBehaviors.d.ts.map +1 -0
- package/dist/matterbridgeBehaviors.js +61 -1
- package/dist/matterbridgeBehaviors.js.map +1 -0
- package/dist/matterbridgeDeviceTypes.d.ts +709 -0
- package/dist/matterbridgeDeviceTypes.d.ts.map +1 -0
- package/dist/matterbridgeDeviceTypes.js +579 -15
- package/dist/matterbridgeDeviceTypes.js.map +1 -0
- package/dist/matterbridgeDynamicPlatform.d.ts +42 -0
- package/dist/matterbridgeDynamicPlatform.d.ts.map +1 -0
- package/dist/matterbridgeDynamicPlatform.js +36 -0
- package/dist/matterbridgeDynamicPlatform.js.map +1 -0
- package/dist/matterbridgeEndpoint.d.ts +1179 -0
- package/dist/matterbridgeEndpoint.d.ts.map +1 -0
- package/dist/matterbridgeEndpoint.js +1027 -42
- package/dist/matterbridgeEndpoint.js.map +1 -0
- package/dist/matterbridgeEndpointHelpers.d.ts +3198 -0
- package/dist/matterbridgeEndpointHelpers.d.ts.map +1 -0
- package/dist/matterbridgeEndpointHelpers.js +322 -12
- package/dist/matterbridgeEndpointHelpers.js.map +1 -0
- package/dist/matterbridgePlatform.d.ts +310 -0
- package/dist/matterbridgePlatform.d.ts.map +1 -0
- package/dist/matterbridgePlatform.js +233 -0
- package/dist/matterbridgePlatform.js.map +1 -0
- package/dist/matterbridgeTypes.d.ts +192 -0
- package/dist/matterbridgeTypes.d.ts.map +1 -0
- package/dist/matterbridgeTypes.js +25 -0
- package/dist/matterbridgeTypes.js.map +1 -0
- package/dist/pluginManager.d.ts +291 -0
- package/dist/pluginManager.d.ts.map +1 -0
- package/dist/pluginManager.js +269 -5
- package/dist/pluginManager.js.map +1 -0
- package/dist/shelly.d.ts +174 -0
- package/dist/shelly.d.ts.map +1 -0
- package/dist/shelly.js +168 -7
- package/dist/shelly.js.map +1 -0
- package/dist/storage/export.d.ts +2 -0
- package/dist/storage/export.d.ts.map +1 -0
- package/dist/storage/export.js +1 -0
- package/dist/storage/export.js.map +1 -0
- package/dist/update.d.ts +59 -0
- package/dist/update.d.ts.map +1 -0
- package/dist/update.js +54 -0
- package/dist/update.js.map +1 -0
- package/dist/utils/colorUtils.d.ts +117 -0
- package/dist/utils/colorUtils.d.ts.map +1 -0
- package/dist/utils/colorUtils.js +263 -2
- package/dist/utils/colorUtils.js.map +1 -0
- package/dist/utils/commandLine.d.ts +59 -0
- package/dist/utils/commandLine.d.ts.map +1 -0
- package/dist/utils/commandLine.js +54 -0
- package/dist/utils/commandLine.js.map +1 -0
- package/dist/utils/copyDirectory.d.ts +33 -0
- package/dist/utils/copyDirectory.d.ts.map +1 -0
- package/dist/utils/copyDirectory.js +38 -1
- package/dist/utils/copyDirectory.js.map +1 -0
- package/dist/utils/createDirectory.d.ts +34 -0
- package/dist/utils/createDirectory.d.ts.map +1 -0
- package/dist/utils/createDirectory.js +33 -0
- package/dist/utils/createDirectory.js.map +1 -0
- package/dist/utils/createZip.d.ts +39 -0
- package/dist/utils/createZip.d.ts.map +1 -0
- package/dist/utils/createZip.js +47 -2
- package/dist/utils/createZip.js.map +1 -0
- package/dist/utils/deepCopy.d.ts +32 -0
- package/dist/utils/deepCopy.d.ts.map +1 -0
- package/dist/utils/deepCopy.js +39 -0
- package/dist/utils/deepCopy.js.map +1 -0
- package/dist/utils/deepEqual.d.ts +54 -0
- package/dist/utils/deepEqual.d.ts.map +1 -0
- package/dist/utils/deepEqual.js +72 -1
- package/dist/utils/deepEqual.js.map +1 -0
- package/dist/utils/export.d.ts +12 -0
- package/dist/utils/export.d.ts.map +1 -0
- package/dist/utils/export.js +1 -0
- package/dist/utils/export.js.map +1 -0
- package/dist/utils/hex.d.ts +49 -0
- package/dist/utils/hex.d.ts.map +1 -0
- package/dist/utils/hex.js +58 -0
- package/dist/utils/hex.js.map +1 -0
- package/dist/utils/isvalid.d.ts +103 -0
- package/dist/utils/isvalid.d.ts.map +1 -0
- package/dist/utils/isvalid.js +101 -0
- package/dist/utils/isvalid.js.map +1 -0
- package/dist/utils/network.d.ts +76 -0
- package/dist/utils/network.d.ts.map +1 -0
- package/dist/utils/network.js +83 -5
- package/dist/utils/network.js.map +1 -0
- package/dist/utils/spawn.d.ts +11 -0
- package/dist/utils/spawn.d.ts.map +1 -0
- package/dist/utils/spawn.js +18 -0
- package/dist/utils/spawn.js.map +1 -0
- package/dist/utils/wait.d.ts +56 -0
- package/dist/utils/wait.d.ts.map +1 -0
- package/dist/utils/wait.js +62 -9
- package/dist/utils/wait.js.map +1 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -1
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description This file contains the LaundryWasher class.
|
|
3
|
+
* @file src/devices/laundryWasher.ts
|
|
4
|
+
* @author Luca Liguori
|
|
5
|
+
* @created 2025-05-25
|
|
6
|
+
* @version 1.1.0
|
|
7
|
+
* @license Apache-2.0
|
|
8
|
+
*
|
|
9
|
+
* Copyright 2025, 2026, 2027 Luca Liguori.
|
|
10
|
+
*
|
|
11
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
|
+
* you may not use this file except in compliance with the License.
|
|
13
|
+
* You may obtain a copy of the License at
|
|
14
|
+
*
|
|
15
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
+
*
|
|
17
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
18
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
+
* See the License for the specific language governing permissions and
|
|
21
|
+
* limitations under the License.
|
|
22
|
+
*/
|
|
1
23
|
import { LaundryWasherControls } from '@matter/main/clusters/laundry-washer-controls';
|
|
2
24
|
import { LaundryWasherMode } from '@matter/main/clusters/laundry-washer-mode';
|
|
3
25
|
import { TemperatureControl } from '@matter/main/clusters/temperature-control';
|
|
@@ -5,10 +27,34 @@ import { ModeBase } from '@matter/main/clusters/mode-base';
|
|
|
5
27
|
import { TemperatureControlServer } from '@matter/main/behaviors/temperature-control';
|
|
6
28
|
import { LaundryWasherModeServer } from '@matter/main/behaviors/laundry-washer-mode';
|
|
7
29
|
import { LaundryWasherControlsServer } from '@matter/main/behaviors/laundry-washer-controls';
|
|
30
|
+
// Matterbridge
|
|
8
31
|
import { laundryWasher, powerSource } from '../matterbridgeDeviceTypes.js';
|
|
9
32
|
import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
|
|
10
33
|
import { MatterbridgeOnOffServer, MatterbridgeServer } from '../matterbridgeBehaviors.js';
|
|
11
34
|
export class LaundryWasher extends MatterbridgeEndpoint {
|
|
35
|
+
/**
|
|
36
|
+
* Creates an instance of the LaundryWasher class.
|
|
37
|
+
*
|
|
38
|
+
* @param {string} name - The name of the laundry washer.
|
|
39
|
+
* @param {string} serial - The serial number of the laundry washer.
|
|
40
|
+
* @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.
|
|
41
|
+
* @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.
|
|
42
|
+
* @param {number} [spinSpeedCurrent] - The current spin speed as index of the spinSpeeds array. Defaults to 2 (which corresponds to '1200').
|
|
43
|
+
* @param {string[]} [spinSpeeds] - The supported spin speeds. Defaults to ['400', '800', '1200', '1600'].
|
|
44
|
+
* @param {LaundryWasherControls.NumberOfRinses} [numberOfRinses] - The number of rinses. Defaults to LaundryWasherControls.NumberOfRinses.Normal (which corresponds to 1 rinse).
|
|
45
|
+
* @param {LaundryWasherControls.NumberOfRinses[]} [supportedRinses] - The supported rinses. Defaults to [NumberOfRinses.None, NumberOfRinses.Normal, NumberOfRinses.Max, NumberOfRinses.Extra].
|
|
46
|
+
* @param {number} [selectedTemperatureLevel] - The selected temperature level as an index of the supportedTemperatureLevels array. Defaults to 1 (which corresponds to 'Warm').
|
|
47
|
+
* @param {string[]} [supportedTemperatureLevels] - The supported temperature levels. Defaults to ['Cold', 'Warm', 'Hot', '30°', '40°', '60°', '80°']. Fixed attribute.
|
|
48
|
+
* @param {number} [temperatureSetpoint] - The temperature setpoint * 100. Defaults to 40 * 100 (which corresponds to 40°C).
|
|
49
|
+
* @param {number} [minTemperature] - The minimum temperature * 100. Defaults to 30 * 100 (which corresponds to 30°C). Fixed attribute.
|
|
50
|
+
* @param {number} [maxTemperature] - The maximum temperature * 100. Defaults to 60 * 100 (which corresponds to 60°C). Fixed attribute.
|
|
51
|
+
* @param {number} [step] - The step size for temperature changes. Defaults to 10 * 100 (which corresponds to 10°C). Fixed attribute.
|
|
52
|
+
* @param {OperationalState.OperationalStateEnum} [operationalState] - The operational state of the laundry washer. Defaults to OperationalState.OperationalStateEnum.Off.
|
|
53
|
+
*
|
|
54
|
+
* Remarks:
|
|
55
|
+
* - If `temperatureSetpoint` is provided, the `createNumberTemperatureControlClusterServer` method will be used to create the TemperatureControl Cluster Server with features TemperatureNumber and TemperatureStep.
|
|
56
|
+
* - If `temperatureSetpoint` is not provided, the `createLevelTemperatureControlClusterServer` method will be used to create the TemperatureControl Cluster Server with feature TemperatureLevel.
|
|
57
|
+
*/
|
|
12
58
|
constructor(name, serial, currentMode, supportedModes, spinSpeedCurrent, spinSpeeds, numberOfRinses, supportedRinses, selectedTemperatureLevel, supportedTemperatureLevels, temperatureSetpoint, minTemperature, maxTemperature, step, operationalState) {
|
|
13
59
|
super([laundryWasher, powerSource], { uniqueStorageKey: `${name.replaceAll(' ', '')}-${serial.replaceAll(' ', '')}` }, true);
|
|
14
60
|
this.createDefaultIdentifyClusterServer();
|
|
@@ -23,6 +69,14 @@ export class LaundryWasher extends MatterbridgeEndpoint {
|
|
|
23
69
|
this.createLevelTemperatureControlClusterServer(selectedTemperatureLevel, supportedTemperatureLevels);
|
|
24
70
|
this.createDefaultOperationalStateClusterServer(operationalState);
|
|
25
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Creates a default Laundry Washer Mode Cluster Server.
|
|
74
|
+
*
|
|
75
|
+
* @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.
|
|
76
|
+
* @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.
|
|
77
|
+
*
|
|
78
|
+
* @returns {this} The current MatterbridgeEndpoint instance for chaining.
|
|
79
|
+
*/
|
|
26
80
|
createDefaultLaundryWasherModeClusterServer(currentMode = 2, supportedModes = [
|
|
27
81
|
{ label: 'Delicate', mode: 1, modeTags: [{ value: LaundryWasherMode.ModeTag.Delicate }] },
|
|
28
82
|
{ label: 'Normal', mode: 2, modeTags: [{ value: LaundryWasherMode.ModeTag.Normal }] },
|
|
@@ -30,20 +84,38 @@ export class LaundryWasher extends MatterbridgeEndpoint {
|
|
|
30
84
|
{ label: 'Whites', mode: 4, modeTags: [{ value: LaundryWasherMode.ModeTag.Whites }] },
|
|
31
85
|
]) {
|
|
32
86
|
this.behaviors.require(MatterbridgeLaundryWasherModeServer, {
|
|
33
|
-
supportedModes,
|
|
34
|
-
currentMode,
|
|
87
|
+
supportedModes, // Fixed attribute.
|
|
88
|
+
currentMode, // Persistent attribute.
|
|
35
89
|
});
|
|
36
90
|
return this;
|
|
37
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* Creates a Laundry Washer Controls Cluster Server with feature Spin for selecting the spin speed and feature Rinse for selecting the number of rinses.
|
|
94
|
+
*
|
|
95
|
+
* @param {number} spinSpeedCurrent - The current spin speed as index of the spinSpeeds array. Default to 2 (which corresponds to '1200').
|
|
96
|
+
* @param {string[]} spinSpeeds - The supported spin speeds. Default to ['400', '800', '1200', '1600'].
|
|
97
|
+
* @param {LaundryWasherControls.NumberOfRinses} numberOfRinses - The number of rinses. Default to LaundryWasherControls.NumberOfRinses.Normal (which corresponds to 1 rinse).
|
|
98
|
+
* @param {LaundryWasherControls.NumberOfRinses[]} supportedRinses - The supported rinses. Default to [NumberOfRinses.None, NumberOfRinses.Normal, NumberOfRinses.Max, NumberOfRinses.Extra].
|
|
99
|
+
*
|
|
100
|
+
* @returns {this} The current MatterbridgeEndpoint instance for chaining.
|
|
101
|
+
*/
|
|
38
102
|
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]) {
|
|
39
103
|
this.behaviors.require(LaundryWasherControlsServer.with(LaundryWasherControls.Feature.Spin, LaundryWasherControls.Feature.Rinse), {
|
|
40
104
|
spinSpeeds,
|
|
41
|
-
spinSpeedCurrent,
|
|
105
|
+
spinSpeedCurrent, // Writable and nullable
|
|
42
106
|
supportedRinses,
|
|
43
|
-
numberOfRinses,
|
|
107
|
+
numberOfRinses, // Writable
|
|
44
108
|
});
|
|
45
109
|
return this;
|
|
46
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* Creates a TemperatureControl Cluster Server with feature TemperatureLevel.
|
|
113
|
+
*
|
|
114
|
+
* @param {number} selectedTemperatureLevel - The selected temperature level as an index of the supportedTemperatureLevels array. Defaults to 1 (which corresponds to 'Warm').
|
|
115
|
+
* @param {string[]} supportedTemperatureLevels - The supported temperature levels. Defaults to ['Cold', 'Warm', 'Hot', '30°', '40°', '60°', '80°']. Fixed attribute.
|
|
116
|
+
*
|
|
117
|
+
* @returns {this} The current MatterbridgeEndpoint instance for chaining.
|
|
118
|
+
*/
|
|
47
119
|
createLevelTemperatureControlClusterServer(selectedTemperatureLevel = 1, supportedTemperatureLevels = ['Cold', 'Warm', 'Hot', '30°', '40°', '60°', '80°']) {
|
|
48
120
|
this.behaviors.require(MatterbridgeLevelTemperatureControlServer.with(TemperatureControl.Feature.TemperatureLevel), {
|
|
49
121
|
selectedTemperatureLevel,
|
|
@@ -51,12 +123,22 @@ export class LaundryWasher extends MatterbridgeEndpoint {
|
|
|
51
123
|
});
|
|
52
124
|
return this;
|
|
53
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* Creates a TemperatureControl Cluster Server with features TemperatureNumber and TemperatureStep.
|
|
128
|
+
*
|
|
129
|
+
* @param {number} temperatureSetpoint - The temperature setpoint * 100. Defaults to 40 * 100 (which corresponds to 40°C).
|
|
130
|
+
* @param {number} minTemperature - The minimum temperature * 100. Defaults to 30 * 100 (which corresponds to 30°C). Fixed attribute.
|
|
131
|
+
* @param {number} maxTemperature - The maximum temperature * 100. Defaults to 60 * 100 (which corresponds to 60°C). Fixed attribute.
|
|
132
|
+
* @param {number} [step] - The step size for temperature changes. Defaults to 10 * 100 (which corresponds to 10°C). Fixed attribute.
|
|
133
|
+
*
|
|
134
|
+
* @returns {this} The current MatterbridgeEndpoint instance for chaining.
|
|
135
|
+
*/
|
|
54
136
|
createNumberTemperatureControlClusterServer(temperatureSetpoint = 40 * 100, minTemperature = 30 * 100, maxTemperature = 60 * 100, step = 10 * 100) {
|
|
55
137
|
this.behaviors.require(MatterbridgeNumberTemperatureControlServer.with(TemperatureControl.Feature.TemperatureNumber, TemperatureControl.Feature.TemperatureStep), {
|
|
56
138
|
temperatureSetpoint,
|
|
57
|
-
minTemperature,
|
|
58
|
-
maxTemperature,
|
|
59
|
-
step,
|
|
139
|
+
minTemperature, // Fixed attribute
|
|
140
|
+
maxTemperature, // Fixed attribute
|
|
141
|
+
step, // Fixed attribute
|
|
60
142
|
});
|
|
61
143
|
return this;
|
|
62
144
|
}
|
|
@@ -105,6 +187,7 @@ export class MatterbridgeLaundryWasherModeServer extends LaundryWasherModeServer
|
|
|
105
187
|
device.log.info(`MatterbridgeLaundryWasherModeServer initialized: currentMode is ${this.state.currentMode}`);
|
|
106
188
|
this.reactTo(this.agent.get(MatterbridgeOnOffServer).events.onOff$Changed, this.handleOnOffChange);
|
|
107
189
|
}
|
|
190
|
+
// Dead Front OnOff Cluster
|
|
108
191
|
handleOnOffChange(onOff) {
|
|
109
192
|
const device = this.endpoint.stateOf(MatterbridgeServer);
|
|
110
193
|
device.log.info(`HandleOnOffChange (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
|
|
@@ -129,3 +212,4 @@ export class MatterbridgeLaundryWasherModeServer extends LaundryWasherModeServer
|
|
|
129
212
|
}
|
|
130
213
|
}
|
|
131
214
|
}
|
|
215
|
+
//# sourceMappingURL=laundryWasher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"laundryWasher.js","sourceRoot":"","sources":["../../src/devices/laundryWasher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,OAAO,EAAE,qBAAqB,EAAE,MAAM,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AG,CAAC,KAAK,CAAC,8EAA8E,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;YAClH,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,gBAAgB,CAAC,aAAa,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC;QACzF,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,103 @@
|
|
|
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
|
+
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 {number} [currentRunMode] - The current run mode of the robotic vacuum cleaner. Defaults to 1 (Idle).
|
|
41
|
+
* @param {RvcRunMode.ModeOption[]} [supportedRunModes] - The supported run modes for the robotic vacuum cleaner. Defaults to a predefined set of modes.
|
|
42
|
+
* @param {number} [currentCleanMode] - The current clean mode of the robotic vacuum cleaner. Defaults to 1 (Vacuum).
|
|
43
|
+
* @param {RvcCleanMode.ModeOption[]} [supportedCleanModes] - The supported clean modes for the robotic vacuum cleaner. Defaults to a predefined set of modes.
|
|
44
|
+
* @param {number | null} [currentPhase] - The current phase of the robotic vacuum cleaner. Defaults to null.
|
|
45
|
+
* @param {string[] | null} [phaseList] - The list of phases for the robotic vacuum cleaner. Defaults to null.
|
|
46
|
+
* @param {RvcOperationalState.OperationalState} [operationalState] - The current operational state of the robotic vacuum cleaner. Defaults to Docked.
|
|
47
|
+
* @param {RvcOperationalState.OperationalStateStruct[]} [operationalStateList] - The list of operational states for the robotic vacuum cleaner. Defaults to a predefined set of states.
|
|
48
|
+
* @param {ServiceArea.Area[]} [supportedAreas] - The supported areas for the robotic vacuum cleaner. Defaults to a predefined set of areas.
|
|
49
|
+
* @param {number[]} [selectedAreas] - The selected areas for the robotic vacuum cleaner. Defaults to an empty array (all areas allowed).
|
|
50
|
+
* @param {number} [currentArea] - The current area of the robotic vacuum cleaner. Defaults to 1 (Living).
|
|
51
|
+
*/
|
|
52
|
+
constructor(name: string, serial: string, 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);
|
|
53
|
+
/**
|
|
54
|
+
* Creates a default RvcRunMode Cluster Server.
|
|
55
|
+
*
|
|
56
|
+
* @param {number} [currentMode] - The current mode of the RvcRunMode cluster. Defaults to 1 (Idle).
|
|
57
|
+
* @param {RvcRunMode.ModeOption[]} [supportedModes] - The supported modes for the RvcRunMode cluster. Defaults to a predefined set of modes.
|
|
58
|
+
*
|
|
59
|
+
* @returns {this} The current MatterbridgeEndpoint instance for chaining.
|
|
60
|
+
*/
|
|
61
|
+
createDefaultRvcRunModeClusterServer(currentMode?: number, supportedModes?: RvcRunMode.ModeOption[]): this;
|
|
62
|
+
/**
|
|
63
|
+
* Creates a default RvcCleanMode Cluster Server.
|
|
64
|
+
*
|
|
65
|
+
* @param {number} [currentMode] - The current mode of the RvcCleanMode cluster. Defaults to 1 (Vacuum).
|
|
66
|
+
* @param {RvcCleanMode.ModeOption[]} [supportedModes] - The supported modes for the RvcCleanMode cluster. Defaults to a predefined set of modes.
|
|
67
|
+
*
|
|
68
|
+
* @returns {this} The current MatterbridgeEndpoint instance for chaining.
|
|
69
|
+
*/
|
|
70
|
+
createDefaultRvcCleanModeClusterServer(currentMode?: number, supportedModes?: RvcCleanMode.ModeOption[]): this;
|
|
71
|
+
/**
|
|
72
|
+
* Creates a default ServiceArea Cluster Server.
|
|
73
|
+
*
|
|
74
|
+
* @param {ServiceArea.Area[]} [supportedAreas] - The supported areas for the ServiceArea cluster. Defaults to a predefined set of areas.
|
|
75
|
+
* @param {number[]} [selectedAreas] - The selected areas for the ServiceArea cluster. Defaults to an empty array (all areas allowed).
|
|
76
|
+
* @param {number} [currentArea] - The current area of the ServiceArea cluster. Defaults to 1 (Living).
|
|
77
|
+
* @returns {this} The current MatterbridgeEndpoint instance for chaining.
|
|
78
|
+
*/
|
|
79
|
+
createDefaultServiceAreaClusterServer(supportedAreas?: ServiceArea.Area[], selectedAreas?: number[], currentArea?: number): this;
|
|
80
|
+
/**
|
|
81
|
+
* Creates a default RvcOperationalState Cluster Server.
|
|
82
|
+
*
|
|
83
|
+
* @param {string[] | null} [phaseList] - The list of phases for the RvcOperationalState cluster. Defaults to null.
|
|
84
|
+
* @param {number | null} [currentPhase] - The current phase of the RvcOperationalState cluster. Defaults to null.
|
|
85
|
+
* @param {RvcOperationalState.OperationalStateStruct[]} [operationalStateList] - The list of operational states for the RvcOperationalState cluster. Defaults to a predefined set of states.
|
|
86
|
+
* @param {RvcOperationalState.OperationalState} [operationalState] - The current operational state of the RvcOperationalState cluster. Defaults to Docked.
|
|
87
|
+
* @param {RvcOperationalState.ErrorStateStruct} [operationalError] - The current operational error of the RvcOperationalState cluster. Defaults to NoError.
|
|
88
|
+
* @returns {this} The current MatterbridgeEndpoint instance for chaining.
|
|
89
|
+
*/
|
|
90
|
+
createDefaultRvcOperationalStateClusterServer(phaseList?: string[] | null, currentPhase?: number | null, operationalStateList?: RvcOperationalState.OperationalStateStruct[], operationalState?: RvcOperationalState.OperationalState, operationalError?: RvcOperationalState.ErrorStateStruct): this;
|
|
91
|
+
}
|
|
92
|
+
export declare class MatterbridgeRvcRunModeServer extends RvcRunModeServer {
|
|
93
|
+
changeToMode(request: ModeBase.ChangeToModeRequest): MaybePromise<ModeBase.ChangeToModeResponse>;
|
|
94
|
+
}
|
|
95
|
+
export declare class MatterbridgeRvcCleanModeServer extends RvcCleanModeServer {
|
|
96
|
+
changeToMode(request: ModeBase.ChangeToModeRequest): MaybePromise<ModeBase.ChangeToModeResponse>;
|
|
97
|
+
}
|
|
98
|
+
export declare class MatterbridgeRvcOperationalStateServer extends RvcOperationalStateServer {
|
|
99
|
+
pause(): MaybePromise<OperationalState.OperationalCommandResponse>;
|
|
100
|
+
resume(): MaybePromise<OperationalState.OperationalCommandResponse>;
|
|
101
|
+
goHome(): MaybePromise<OperationalState.OperationalCommandResponse>;
|
|
102
|
+
}
|
|
103
|
+
//# 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,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,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,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAG3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAIlE,qBAAa,oBAAqB,SAAQ,oBAAoB;IAC5D;;;;;;;;;;;;;;;;OAgBG;gBAED,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,cAAc,CAAC,EAAE,MAAM,EACvB,iBAAiB,CAAC,EAAE,UAAU,CAAC,UAAU,EAAE,EAC3C,gBAAgB,CAAC,EAAE,MAAM,EACzB,mBAAmB,CAAC,EAAE,YAAY,CAAC,UAAU,EAAE,EA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AY,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,25 @@
|
|
|
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
|
+
*/
|
|
1
23
|
import { RvcRunModeServer } from '@matter/main/behaviors/rvc-run-mode';
|
|
2
24
|
import { RvcOperationalStateServer } from '@matter/main/behaviors/rvc-operational-state';
|
|
3
25
|
import { RvcCleanModeServer } from '@matter/main/behaviors/rvc-clean-mode';
|
|
@@ -7,10 +29,28 @@ import { RvcCleanMode } from '@matter/main/clusters/rvc-clean-mode';
|
|
|
7
29
|
import { RvcOperationalState } from '@matter/main/clusters/rvc-operational-state';
|
|
8
30
|
import { ModeBase } from '@matter/main/clusters/mode-base';
|
|
9
31
|
import { OperationalState } from '@matter/main/clusters/operational-state';
|
|
32
|
+
// Matterbridge
|
|
10
33
|
import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
|
|
11
34
|
import { powerSource, roboticVacuumCleaner } from '../matterbridgeDeviceTypes.js';
|
|
12
35
|
import { MatterbridgeServer, MatterbridgeServiceAreaServer } from '../matterbridgeBehaviors.js';
|
|
13
36
|
export class RoboticVacuumCleaner extends MatterbridgeEndpoint {
|
|
37
|
+
/**
|
|
38
|
+
* Creates an instance of the RoboticVacuumCleaner class.
|
|
39
|
+
*
|
|
40
|
+
* @param {string} name - The name of the robotic vacuum cleaner.
|
|
41
|
+
* @param {string} serial - The serial number of the robotic vacuum cleaner.
|
|
42
|
+
* @param {number} [currentRunMode] - The current run mode of the robotic vacuum cleaner. Defaults to 1 (Idle).
|
|
43
|
+
* @param {RvcRunMode.ModeOption[]} [supportedRunModes] - The supported run modes for the robotic vacuum cleaner. Defaults to a predefined set of modes.
|
|
44
|
+
* @param {number} [currentCleanMode] - The current clean mode of the robotic vacuum cleaner. Defaults to 1 (Vacuum).
|
|
45
|
+
* @param {RvcCleanMode.ModeOption[]} [supportedCleanModes] - The supported clean modes for the robotic vacuum cleaner. Defaults to a predefined set of modes.
|
|
46
|
+
* @param {number | null} [currentPhase] - The current phase of the robotic vacuum cleaner. Defaults to null.
|
|
47
|
+
* @param {string[] | null} [phaseList] - The list of phases for the robotic vacuum cleaner. Defaults to null.
|
|
48
|
+
* @param {RvcOperationalState.OperationalState} [operationalState] - The current operational state of the robotic vacuum cleaner. Defaults to Docked.
|
|
49
|
+
* @param {RvcOperationalState.OperationalStateStruct[]} [operationalStateList] - The list of operational states for the robotic vacuum cleaner. Defaults to a predefined set of states.
|
|
50
|
+
* @param {ServiceArea.Area[]} [supportedAreas] - The supported areas for the robotic vacuum cleaner. Defaults to a predefined set of areas.
|
|
51
|
+
* @param {number[]} [selectedAreas] - The selected areas for the robotic vacuum cleaner. Defaults to an empty array (all areas allowed).
|
|
52
|
+
* @param {number} [currentArea] - The current area of the robotic vacuum cleaner. Defaults to 1 (Living).
|
|
53
|
+
*/
|
|
14
54
|
constructor(name, serial, currentRunMode, supportedRunModes, currentCleanMode, supportedCleanModes, currentPhase = null, phaseList = null, operationalState, operationalStateList, supportedAreas, selectedAreas, currentArea) {
|
|
15
55
|
super([roboticVacuumCleaner, powerSource], { uniqueStorageKey: `${name.replaceAll(' ', '')}-${serial.replaceAll(' ', '')}` }, true);
|
|
16
56
|
this.createDefaultIdentifyClusterServer()
|
|
@@ -21,6 +61,14 @@ export class RoboticVacuumCleaner extends MatterbridgeEndpoint {
|
|
|
21
61
|
.createDefaultRvcOperationalStateClusterServer(phaseList, currentPhase, operationalStateList, operationalState)
|
|
22
62
|
.createDefaultServiceAreaClusterServer(supportedAreas, selectedAreas, currentArea);
|
|
23
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Creates a default RvcRunMode Cluster Server.
|
|
66
|
+
*
|
|
67
|
+
* @param {number} [currentMode] - The current mode of the RvcRunMode cluster. Defaults to 1 (Idle).
|
|
68
|
+
* @param {RvcRunMode.ModeOption[]} [supportedModes] - The supported modes for the RvcRunMode cluster. Defaults to a predefined set of modes.
|
|
69
|
+
*
|
|
70
|
+
* @returns {this} The current MatterbridgeEndpoint instance for chaining.
|
|
71
|
+
*/
|
|
24
72
|
createDefaultRvcRunModeClusterServer(currentMode, supportedModes) {
|
|
25
73
|
this.behaviors.require(MatterbridgeRvcRunModeServer, {
|
|
26
74
|
supportedModes: supportedModes ?? [
|
|
@@ -33,6 +81,14 @@ export class RoboticVacuumCleaner extends MatterbridgeEndpoint {
|
|
|
33
81
|
});
|
|
34
82
|
return this;
|
|
35
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Creates a default RvcCleanMode Cluster Server.
|
|
86
|
+
*
|
|
87
|
+
* @param {number} [currentMode] - The current mode of the RvcCleanMode cluster. Defaults to 1 (Vacuum).
|
|
88
|
+
* @param {RvcCleanMode.ModeOption[]} [supportedModes] - The supported modes for the RvcCleanMode cluster. Defaults to a predefined set of modes.
|
|
89
|
+
*
|
|
90
|
+
* @returns {this} The current MatterbridgeEndpoint instance for chaining.
|
|
91
|
+
*/
|
|
36
92
|
createDefaultRvcCleanModeClusterServer(currentMode, supportedModes) {
|
|
37
93
|
this.behaviors.require(MatterbridgeRvcCleanModeServer, {
|
|
38
94
|
supportedModes: supportedModes ?? [
|
|
@@ -44,6 +100,14 @@ export class RoboticVacuumCleaner extends MatterbridgeEndpoint {
|
|
|
44
100
|
});
|
|
45
101
|
return this;
|
|
46
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* Creates a default ServiceArea Cluster Server.
|
|
105
|
+
*
|
|
106
|
+
* @param {ServiceArea.Area[]} [supportedAreas] - The supported areas for the ServiceArea cluster. Defaults to a predefined set of areas.
|
|
107
|
+
* @param {number[]} [selectedAreas] - The selected areas for the ServiceArea cluster. Defaults to an empty array (all areas allowed).
|
|
108
|
+
* @param {number} [currentArea] - The current area of the ServiceArea cluster. Defaults to 1 (Living).
|
|
109
|
+
* @returns {this} The current MatterbridgeEndpoint instance for chaining.
|
|
110
|
+
*/
|
|
47
111
|
createDefaultServiceAreaClusterServer(supportedAreas, selectedAreas, currentArea) {
|
|
48
112
|
this.behaviors.require(MatterbridgeServiceAreaServer, {
|
|
49
113
|
supportedAreas: supportedAreas ?? [
|
|
@@ -74,6 +138,16 @@ export class RoboticVacuumCleaner extends MatterbridgeEndpoint {
|
|
|
74
138
|
});
|
|
75
139
|
return this;
|
|
76
140
|
}
|
|
141
|
+
/**
|
|
142
|
+
* Creates a default RvcOperationalState Cluster Server.
|
|
143
|
+
*
|
|
144
|
+
* @param {string[] | null} [phaseList] - The list of phases for the RvcOperationalState cluster. Defaults to null.
|
|
145
|
+
* @param {number | null} [currentPhase] - The current phase of the RvcOperationalState cluster. Defaults to null.
|
|
146
|
+
* @param {RvcOperationalState.OperationalStateStruct[]} [operationalStateList] - The list of operational states for the RvcOperationalState cluster. Defaults to a predefined set of states.
|
|
147
|
+
* @param {RvcOperationalState.OperationalState} [operationalState] - The current operational state of the RvcOperationalState cluster. Defaults to Docked.
|
|
148
|
+
* @param {RvcOperationalState.ErrorStateStruct} [operationalError] - The current operational error of the RvcOperationalState cluster. Defaults to NoError.
|
|
149
|
+
* @returns {this} The current MatterbridgeEndpoint instance for chaining.
|
|
150
|
+
*/
|
|
77
151
|
createDefaultRvcOperationalStateClusterServer(phaseList = null, currentPhase = null, operationalStateList, operationalState, operationalError) {
|
|
78
152
|
this.behaviors.require(MatterbridgeRvcOperationalStateServer, {
|
|
79
153
|
phaseList,
|
|
@@ -83,9 +157,9 @@ export class RoboticVacuumCleaner extends MatterbridgeEndpoint {
|
|
|
83
157
|
{ operationalStateId: RvcOperationalState.OperationalState.Running, operationalStateLabel: 'Running' },
|
|
84
158
|
{ operationalStateId: RvcOperationalState.OperationalState.Paused, operationalStateLabel: 'Paused' },
|
|
85
159
|
{ operationalStateId: RvcOperationalState.OperationalState.Error, operationalStateLabel: 'Error' },
|
|
86
|
-
{ operationalStateId: RvcOperationalState.OperationalState.SeekingCharger, operationalStateLabel: 'SeekingCharger' },
|
|
87
|
-
{ operationalStateId: RvcOperationalState.OperationalState.Charging, operationalStateLabel: 'Charging' },
|
|
88
|
-
{ operationalStateId: RvcOperationalState.OperationalState.Docked, operationalStateLabel: 'Docked' },
|
|
160
|
+
{ operationalStateId: RvcOperationalState.OperationalState.SeekingCharger, operationalStateLabel: 'SeekingCharger' }, // Y RVC Pause Compatibility N RVC Resume Compatibility
|
|
161
|
+
{ operationalStateId: RvcOperationalState.OperationalState.Charging, operationalStateLabel: 'Charging' }, // N RVC Pause Compatibility Y RVC Resume Compatibility
|
|
162
|
+
{ operationalStateId: RvcOperationalState.OperationalState.Docked, operationalStateLabel: 'Docked' }, // N RVC Pause Compatibility Y RVC Resume Compatibility
|
|
89
163
|
],
|
|
90
164
|
operationalState: operationalState ?? RvcOperationalState.OperationalState.Docked,
|
|
91
165
|
operationalError: operationalError ?? { errorStateId: RvcOperationalState.ErrorState.NoError, errorStateLabel: 'No Error', errorStateDetails: 'Fully operational' },
|
|
@@ -140,7 +214,7 @@ export class MatterbridgeRvcOperationalStateServer extends RvcOperationalStateSe
|
|
|
140
214
|
device.log.info(`Pause (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
|
|
141
215
|
device.commandHandler.executeHandler('pause', { request: {}, cluster: RvcOperationalStateServer.id, attributes: this.state, endpoint: this.endpoint });
|
|
142
216
|
device.log.debug('MatterbridgeRvcOperationalStateServer: pause called setting operational state to Paused and currentMode to Idle');
|
|
143
|
-
this.agent.get(MatterbridgeRvcRunModeServer).state.currentMode = 1;
|
|
217
|
+
this.agent.get(MatterbridgeRvcRunModeServer).state.currentMode = 1; // RvcRunMode.ModeTag.Idle
|
|
144
218
|
this.state.operationalState = RvcOperationalState.OperationalState.Paused;
|
|
145
219
|
this.state.operationalError = { errorStateId: RvcOperationalState.ErrorState.NoError, errorStateLabel: 'No Error', errorStateDetails: 'Fully operational' };
|
|
146
220
|
return {
|
|
@@ -152,7 +226,7 @@ export class MatterbridgeRvcOperationalStateServer extends RvcOperationalStateSe
|
|
|
152
226
|
device.log.info(`Resume (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
|
|
153
227
|
device.commandHandler.executeHandler('resume', { request: {}, cluster: RvcOperationalStateServer.id, attributes: this.state, endpoint: this.endpoint });
|
|
154
228
|
device.log.debug('MatterbridgeRvcOperationalStateServer: resume called setting operational state to Running and currentMode to Cleaning');
|
|
155
|
-
this.agent.get(MatterbridgeRvcRunModeServer).state.currentMode = 2;
|
|
229
|
+
this.agent.get(MatterbridgeRvcRunModeServer).state.currentMode = 2; // RvcRunMode.ModeTag.Cleaning
|
|
156
230
|
this.state.operationalState = RvcOperationalState.OperationalState.Running;
|
|
157
231
|
this.state.operationalError = { errorStateId: RvcOperationalState.ErrorState.NoError, errorStateLabel: 'No Error', errorStateDetails: 'Fully operational' };
|
|
158
232
|
return {
|
|
@@ -160,11 +234,12 @@ export class MatterbridgeRvcOperationalStateServer extends RvcOperationalStateSe
|
|
|
160
234
|
};
|
|
161
235
|
}
|
|
162
236
|
goHome() {
|
|
237
|
+
// const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
163
238
|
const device = this.endpoint.stateOf(MatterbridgeServer);
|
|
164
239
|
device.log.info(`GoHome (endpoint ${this.endpoint.maybeId}.${this.endpoint.maybeNumber})`);
|
|
165
240
|
device.commandHandler.executeHandler('goHome', { request: {}, cluster: RvcOperationalStateServer.id, attributes: this.state, endpoint: this.endpoint });
|
|
166
241
|
device.log.debug('MatterbridgeRvcOperationalStateServer: goHome called setting operational state to Docked and currentMode to Idle');
|
|
167
|
-
this.agent.get(MatterbridgeRvcRunModeServer).state.currentMode = 1;
|
|
242
|
+
this.agent.get(MatterbridgeRvcRunModeServer).state.currentMode = 1; // RvcRunMode.ModeTag.Idle
|
|
168
243
|
this.state.operationalState = RvcOperationalState.OperationalState.Docked;
|
|
169
244
|
this.state.operationalError = { errorStateId: RvcOperationalState.ErrorState.NoError, errorStateLabel: 'No Error', errorStateDetails: 'Fully operational' };
|
|
170
245
|
return {
|
|
@@ -172,3 +247,4 @@ export class MatterbridgeRvcOperationalStateServer extends RvcOperationalStateSe
|
|
|
172
247
|
};
|
|
173
248
|
}
|
|
174
249
|
}
|
|
250
|
+
//# sourceMappingURL=roboticVacuumCleaner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roboticVacuumCleaner.js","sourceRoot":"","sources":["../../src/devices/roboticVacuumCleaner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AACzF,OAAO,EAAE,kBAAkB,EAAE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zD,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,oBAAoB,IAAI,CAAC,QAAQ,CAAC,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,GAAG,CAAC,CAAC;QAC3F,MAAM,CAAC,cAAc,CAAC,cAAc,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,yBAAyB,CAAC,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QACxJ,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,kHAAkH,CAAC,CAAC;QACrI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC,KAAK,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC,0BAA0B;QAC9F,IAAI,CAAC,KAAK,CAAC,gBAAgB,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,MAAM,CAAC;QAC1E,IAAI,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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