matterbridge-roborock-vacuum-plugin 1.0.8-rc03 → 1.0.8-rc05

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.
@@ -1,5 +1,5 @@
1
1
  import { RvcCleanMode, RvcOperationalState, RvcRunMode } from 'matterbridge/matter/clusters';
2
- export function getDefaultSupportedRunModes() {
2
+ export function getSupportedRunModesA51() {
3
3
  return [
4
4
  {
5
5
  label: 'Idle',
@@ -18,7 +18,7 @@ export function getDefaultSupportedRunModes() {
18
18
  },
19
19
  ];
20
20
  }
21
- export function getDefaultSupportedCleanModes() {
21
+ export function getSupportedCleanModesA51() {
22
22
  return [
23
23
  {
24
24
  label: 'Mop',
@@ -42,7 +42,7 @@ export function getDefaultSupportedCleanModes() {
42
42
  },
43
43
  ];
44
44
  }
45
- export function getDefaultOperationalStates() {
45
+ export function getOperationalStatesA51() {
46
46
  return [
47
47
  {
48
48
  operationalStateId: RvcOperationalState.OperationalState.Stopped,
@@ -4,12 +4,15 @@ import { getDefaultOperationalStates } from '../behaviors/roborock.vacuum/defaul
4
4
  import { DeviceModel } from '../roborockCommunication/Zmodel/deviceModel.js';
5
5
  import { VacuumErrorCode } from '../roborockCommunication/Zenum/vacuumAndDockErrorCode.js';
6
6
  import { getOperationalStatesA27 } from '../behaviors/roborock.vacuum/S7_MAXV/initalData.js';
7
+ import { getOperationalStatesA51 } from '../behaviors/roborock.vacuum/S8_PRO_ULTRA/initalData.js';
7
8
  export function getOperationalStates(model) {
8
9
  switch (model) {
9
10
  case DeviceModel.QREVO_EDGE_5V1:
10
11
  return getOperationalStatesA187();
11
12
  case DeviceModel.S7_MAXV:
12
13
  return getOperationalStatesA27();
14
+ case DeviceModel.S8_MAXV_ULTRA:
15
+ return getOperationalStatesA51();
13
16
  default:
14
17
  return getDefaultOperationalStates();
15
18
  }
@@ -2,12 +2,15 @@ import { getSupportedCleanModesA187 } from '../behaviors/roborock.vacuum/QREVO_E
2
2
  import { getDefaultSupportedCleanModes } from '../behaviors/roborock.vacuum/default/initalData.js';
3
3
  import { DeviceModel } from '../roborockCommunication/Zmodel/deviceModel.js';
4
4
  import { getSupportedCleanModesA27 } from '../behaviors/roborock.vacuum/S7_MAXV/initalData.js';
5
+ import { getSupportedCleanModesA51 } from '../behaviors/roborock.vacuum/S8_PRO_ULTRA/initalData.js';
5
6
  export function getSupportedCleanModes(model) {
6
7
  switch (model) {
7
8
  case DeviceModel.QREVO_EDGE_5V1:
8
9
  return getSupportedCleanModesA187();
9
10
  case DeviceModel.S7_MAXV:
10
11
  return getSupportedCleanModesA27();
12
+ case DeviceModel.S8_PRO_ULTRA:
13
+ return getSupportedCleanModesA51();
11
14
  default:
12
15
  return getDefaultSupportedCleanModes();
13
16
  }
@@ -2,6 +2,7 @@ import { getSupportedRunModesA187 } from '../behaviors/roborock.vacuum/QREVO_EDG
2
2
  import { getDefaultSupportedRunModes } from '../behaviors/roborock.vacuum/default/initalData.js';
3
3
  import { DeviceModel } from '../roborockCommunication/Zmodel/deviceModel.js';
4
4
  import { getSupportedRunModesA27 } from '../behaviors/roborock.vacuum/S7_MAXV/initalData.js';
5
+ import { getSupportedRunModesA51 } from '../behaviors/roborock.vacuum/S8_PRO_ULTRA/initalData.js';
5
6
  export function getRunningMode(model, modeTag) {
6
7
  if (!model || !modeTag)
7
8
  return null;
@@ -15,6 +16,8 @@ export function getSupportedRunModes(model) {
15
16
  return getSupportedRunModesA187();
16
17
  case DeviceModel.S7_MAXV:
17
18
  return getSupportedRunModesA27();
19
+ case DeviceModel.S8_MAXV_ULTRA:
20
+ return getSupportedRunModesA51();
18
21
  default:
19
22
  return getDefaultSupportedRunModes();
20
23
  }
@@ -19,6 +19,5 @@ export function hasDockingStationError(status) {
19
19
  status.waterBoxFilterStatus === DockingStationStatusType.Error ||
20
20
  status.dustBagStatus === DockingStationStatusType.Error ||
21
21
  status.dirtyWaterBoxStatus === DockingStationStatusType.Error ||
22
- status.clearWaterBoxStatus === DockingStationStatusType.Error ||
23
- status.isUpdownWaterReady === DockingStationStatusType.Error);
22
+ status.clearWaterBoxStatus === DockingStationStatusType.Error);
24
23
  }
package/dist/platform.js CHANGED
@@ -1,4 +1,3 @@
1
- import './extensions/index.js';
2
1
  import { MatterbridgeDynamicPlatform } from 'matterbridge';
3
2
  import * as axios from 'axios';
4
3
  import { debugStringify } from 'matterbridge/logger';
@@ -23,8 +22,8 @@ export class RoborockMatterbridgePlatform extends MatterbridgeDynamicPlatform {
23
22
  enableExperimentalFeature;
24
23
  constructor(matterbridge, log, config) {
25
24
  super(matterbridge, log, config);
26
- if (this.verifyMatterbridgeVersion === undefined || typeof this.verifyMatterbridgeVersion !== 'function' || !this.verifyMatterbridgeVersion('3.0.4')) {
27
- throw new Error(`This plugin requires Matterbridge version >= "3.0.4". Please update Matterbridge from ${this.matterbridge.matterbridgeVersion} to the latest version in the frontend.`);
25
+ if (this.verifyMatterbridgeVersion === undefined || typeof this.verifyMatterbridgeVersion !== 'function' || !this.verifyMatterbridgeVersion('3.0.5')) {
26
+ throw new Error(`This plugin requires Matterbridge version >= "3.0.5". Please update Matterbridge from ${this.matterbridge.matterbridgeVersion} to the latest version in the frontend.`);
28
27
  }
29
28
  this.log.info('Initializing platform:', this.config.name);
30
29
  if (config.whiteList === undefined)
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "matterbridge-roborock-vacuum-plugin",
3
3
  "type": "DynamicPlatform",
4
- "version": "1.0.8-rc03",
4
+ "version": "1.0.8-rc05",
5
5
  "whiteList": [],
6
6
  "blackList": [],
7
7
  "useInterval": true,
@@ -33,4 +33,4 @@
33
33
  "debug": true,
34
34
  "unregisterOnShutdown": false,
35
35
  "enableExperimentalFeature": false
36
- }
36
+ }
@@ -1,11 +1,8 @@
1
1
  {
2
2
  "title": "Matterbridge Roborock Vacuum Plugin",
3
- "description": "matterbridge-roborock-vacuum-plugin v. 1.0.8-rc03 by https://github.com/RinDevJunior",
3
+ "description": "matterbridge-roborock-vacuum-plugin v. 1.0.8-rc05 by https://github.com/RinDevJunior",
4
4
  "type": "object",
5
- "required": [
6
- "username",
7
- "password"
8
- ],
5
+ "required": ["username", "password"],
9
6
  "properties": {
10
7
  "name": {
11
8
  "description": "Plugin name",
@@ -60,9 +57,7 @@
60
57
  "const": true
61
58
  }
62
59
  },
63
- "required": [
64
- "enableExperimentalFeature"
65
- ]
60
+ "required": ["enableExperimentalFeature"]
66
61
  },
67
62
  "then": {
68
63
  "properties": {
@@ -99,9 +94,7 @@
99
94
  "const": true
100
95
  }
101
96
  },
102
- "required": [
103
- "enableCleanModeMapping"
104
- ]
97
+ "required": ["enableCleanModeMapping"]
105
98
  },
106
99
  "then": {
107
100
  "properties": {
@@ -146,9 +139,7 @@
146
139
  "default": 25
147
140
  }
148
141
  },
149
- "required": [
150
- "distanceOff"
151
- ]
142
+ "required": ["distanceOff"]
152
143
  }
153
144
  }
154
145
  ]
@@ -185,9 +176,7 @@
185
176
  "default": 25
186
177
  }
187
178
  },
188
- "required": [
189
- "distanceOff"
190
- ]
179
+ "required": ["distanceOff"]
191
180
  }
192
181
  }
193
182
  ]
@@ -217,36 +206,20 @@
217
206
  "fanMode": {
218
207
  "type": "string",
219
208
  "description": "Suction power mode to use (e.g., 'Quiet', 'Balanced', 'Turbo', 'Max', 'MaxPlus').",
220
- "enum": [
221
- "Quiet",
222
- "Balanced",
223
- "Turbo",
224
- "Max",
225
- "MaxPlus"
226
- ],
209
+ "enum": ["Quiet", "Balanced", "Turbo", "Max", "MaxPlus"],
227
210
  "default": "Balanced"
228
211
  },
229
212
  "waterFlowMode": {
230
213
  "type": "string",
231
214
  "description": "Water flow mode to use (e.g., 'Low', 'Medium', 'High', 'CustomizeWithDistanceOff').",
232
- "enum": [
233
- "Low",
234
- "Medium",
235
- "High",
236
- "CustomizeWithDistanceOff"
237
- ],
215
+ "enum": ["Low", "Medium", "High", "CustomizeWithDistanceOff"],
238
216
  "default": "Medium"
239
217
  },
240
218
  "mopRouteMode": {
241
219
  "type": "string",
242
220
  "description": "Mop route intensity to use (e.g., 'Standard', 'Deep', 'DeepPlus', 'Fast').",
243
- "enum": [
244
- "Standard",
245
- "Deep",
246
- "DeepPlus",
247
- "Fast"
248
- ],
221
+ "enum": ["Standard", "Deep", "DeepPlus", "Fast"],
249
222
  "default": "Standard"
250
223
  }
251
224
  }
252
- }
225
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "matterbridge-roborock-vacuum-plugin",
3
- "version": "1.0.8-rc03",
3
+ "version": "1.0.8-rc05",
4
4
  "description": "Matterbridge Roborock Vacuum Plugin",
5
5
  "author": "https://github.com/RinDevJunior",
6
6
  "license": "MIT",
@@ -1,6 +1,6 @@
1
1
  import { RvcCleanMode, RvcOperationalState, RvcRunMode } from 'matterbridge/matter/clusters';
2
2
 
3
- export function getDefaultSupportedRunModes(): RvcRunMode.ModeOption[] {
3
+ export function getSupportedRunModesA51(): RvcRunMode.ModeOption[] {
4
4
  return [
5
5
  {
6
6
  label: 'Idle',
@@ -20,7 +20,7 @@ export function getDefaultSupportedRunModes(): RvcRunMode.ModeOption[] {
20
20
  ];
21
21
  }
22
22
 
23
- export function getDefaultSupportedCleanModes(): RvcCleanMode.ModeOption[] {
23
+ export function getSupportedCleanModesA51(): RvcCleanMode.ModeOption[] {
24
24
  return [
25
25
  {
26
26
  label: 'Mop',
@@ -45,7 +45,7 @@ export function getDefaultSupportedCleanModes(): RvcCleanMode.ModeOption[] {
45
45
  ];
46
46
  }
47
47
 
48
- export function getDefaultOperationalStates(): RvcOperationalState.OperationalStateStruct[] {
48
+ export function getOperationalStatesA51(): RvcOperationalState.OperationalStateStruct[] {
49
49
  return [
50
50
  {
51
51
  operationalStateId: RvcOperationalState.OperationalState.Stopped,
@@ -4,6 +4,7 @@ import { getDefaultOperationalStates } from '../behaviors/roborock.vacuum/defaul
4
4
  import { DeviceModel } from '../roborockCommunication/Zmodel/deviceModel.js';
5
5
  import { VacuumErrorCode } from '../roborockCommunication/Zenum/vacuumAndDockErrorCode.js';
6
6
  import { getOperationalStatesA27 } from '../behaviors/roborock.vacuum/S7_MAXV/initalData.js';
7
+ import { getOperationalStatesA51 } from '../behaviors/roborock.vacuum/S8_PRO_ULTRA/initalData.js';
7
8
 
8
9
  export function getOperationalStates(model: string): RvcOperationalState.OperationalStateStruct[] {
9
10
  switch (model) {
@@ -11,6 +12,8 @@ export function getOperationalStates(model: string): RvcOperationalState.Operati
11
12
  return getOperationalStatesA187();
12
13
  case DeviceModel.S7_MAXV:
13
14
  return getOperationalStatesA27();
15
+ case DeviceModel.S8_MAXV_ULTRA:
16
+ return getOperationalStatesA51();
14
17
  default:
15
18
  return getDefaultOperationalStates();
16
19
  }
@@ -3,6 +3,7 @@ import { getSupportedCleanModesA187 } from '../behaviors/roborock.vacuum/QREVO_E
3
3
  import { getDefaultSupportedCleanModes } from '../behaviors/roborock.vacuum/default/initalData.js';
4
4
  import { DeviceModel } from '../roborockCommunication/Zmodel/deviceModel.js';
5
5
  import { getSupportedCleanModesA27 } from '../behaviors/roborock.vacuum/S7_MAXV/initalData.js';
6
+ import { getSupportedCleanModesA51 } from '../behaviors/roborock.vacuum/S8_PRO_ULTRA/initalData.js';
6
7
 
7
8
  export function getSupportedCleanModes(model: string): RvcCleanMode.ModeOption[] {
8
9
  switch (model) {
@@ -10,6 +11,8 @@ export function getSupportedCleanModes(model: string): RvcCleanMode.ModeOption[]
10
11
  return getSupportedCleanModesA187();
11
12
  case DeviceModel.S7_MAXV:
12
13
  return getSupportedCleanModesA27();
14
+ case DeviceModel.S8_PRO_ULTRA:
15
+ return getSupportedCleanModesA51();
13
16
  default:
14
17
  return getDefaultSupportedCleanModes();
15
18
  }
@@ -3,6 +3,7 @@ import { getSupportedRunModesA187 } from '../behaviors/roborock.vacuum/QREVO_EDG
3
3
  import { getDefaultSupportedRunModes } from '../behaviors/roborock.vacuum/default/initalData.js';
4
4
  import { DeviceModel } from '../roborockCommunication/Zmodel/deviceModel.js';
5
5
  import { getSupportedRunModesA27 } from '../behaviors/roborock.vacuum/S7_MAXV/initalData.js';
6
+ import { getSupportedRunModesA51 } from '../behaviors/roborock.vacuum/S8_PRO_ULTRA/initalData.js';
6
7
 
7
8
  export function getRunningMode(model: string | undefined, modeTag: RvcRunMode.ModeTag | undefined): number | null {
8
9
  if (!model || !modeTag) return null;
@@ -18,6 +19,8 @@ export function getSupportedRunModes(model: string): RvcRunMode.ModeOption[] {
18
19
  return getSupportedRunModesA187();
19
20
  case DeviceModel.S7_MAXV:
20
21
  return getSupportedRunModesA27();
22
+ case DeviceModel.S8_MAXV_ULTRA:
23
+ return getSupportedRunModesA51();
21
24
  default:
22
25
  return getDefaultSupportedRunModes();
23
26
  }
@@ -31,7 +31,7 @@ export function hasDockingStationError(status: DockingStationStatus): boolean {
31
31
  status.waterBoxFilterStatus === DockingStationStatusType.Error ||
32
32
  status.dustBagStatus === DockingStationStatusType.Error ||
33
33
  status.dirtyWaterBoxStatus === DockingStationStatusType.Error ||
34
- status.clearWaterBoxStatus === DockingStationStatusType.Error ||
35
- status.isUpdownWaterReady === DockingStationStatusType.Error
34
+ status.clearWaterBoxStatus === DockingStationStatusType.Error
35
+ // || status.isUpdownWaterReady === DockingStationStatusType.Error
36
36
  );
37
37
  }
package/src/platform.ts CHANGED
@@ -1,4 +1,3 @@
1
- import './extensions/index.js';
2
1
  import { Matterbridge, MatterbridgeDynamicPlatform, PlatformConfig } from 'matterbridge';
3
2
  import * as axios from 'axios';
4
3
  import { AnsiLogger, debugStringify, LogLevel } from 'matterbridge/logger';
@@ -30,9 +29,9 @@ export class RoborockMatterbridgePlatform extends MatterbridgeDynamicPlatform {
30
29
  super(matterbridge, log, config);
31
30
 
32
31
  // Verify that Matterbridge is the correct version
33
- if (this.verifyMatterbridgeVersion === undefined || typeof this.verifyMatterbridgeVersion !== 'function' || !this.verifyMatterbridgeVersion('3.0.4')) {
32
+ if (this.verifyMatterbridgeVersion === undefined || typeof this.verifyMatterbridgeVersion !== 'function' || !this.verifyMatterbridgeVersion('3.0.5')) {
34
33
  throw new Error(
35
- `This plugin requires Matterbridge version >= "3.0.4". Please update Matterbridge from ${this.matterbridge.matterbridgeVersion} to the latest version in the frontend.`,
34
+ `This plugin requires Matterbridge version >= "3.0.5". Please update Matterbridge from ${this.matterbridge.matterbridgeVersion} to the latest version in the frontend.`,
36
35
  );
37
36
  }
38
37
  this.log.info('Initializing platform:', this.config.name);
@@ -31,7 +31,7 @@ describe('DockingStationStatus', () => {
31
31
  waterBoxFilterStatus: 2,
32
32
  dustBagStatus: 2,
33
33
  dirtyWaterBoxStatus: 2,
34
- clearWaterBoxStatus: 2,
34
+ clearWaterBoxStatus: 1, // This means there is a problem with the clear water box
35
35
  isUpdownWaterReady: 1, // This means there is a problem with the updown water
36
36
  };
37
37
  expect(hasDockingStationError(status)).toBe(true);