@switchbot/homebridge-switchbot 5.0.0-beta.52 → 5.0.0-beta.54
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/dist/devices-matter/RoboticVacuumAccessory.d.ts +28 -51
- package/dist/devices-matter/RoboticVacuumAccessory.d.ts.map +1 -1
- package/dist/devices-matter/RoboticVacuumAccessory.js +274 -258
- package/dist/devices-matter/RoboticVacuumAccessory.js.map +1 -1
- package/dist/homebridge-ui/public/index.html +32 -0
- package/dist/test/matter/devices-matter/roboticVacuumAccessory.test.d.ts +2 -0
- package/dist/test/matter/devices-matter/roboticVacuumAccessory.test.d.ts.map +1 -0
- package/dist/test/matter/devices-matter/roboticVacuumAccessory.test.js +366 -0
- package/dist/test/matter/devices-matter/roboticVacuumAccessory.test.js.map +1 -0
- package/docs/variables/default.html +1 -1
- package/package.json +1 -1
- package/src/devices-matter/RoboticVacuumAccessory.ts +326 -309
- package/src/homebridge-ui/public/index.html +32 -0
- package/src/test/matter/devices-matter/roboticVacuumAccessory.test.ts +453 -0
|
@@ -1,29 +1,38 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Robotic Vacuum Cleaner Accessory
|
|
2
|
+
* Robotic Vacuum Cleaner Accessory (SwitchBot-aligned)
|
|
3
3
|
*
|
|
4
|
-
* This is
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* - Operational state management with realistic transitions
|
|
9
|
-
* - Service area (room) support
|
|
4
|
+
* This implementation is intentionally limited to SwitchBot OpenAPI-supported
|
|
5
|
+
* behaviors for Robot Vacuum families. We expose only commands and modes that
|
|
6
|
+
* exist in the public API docs:
|
|
7
|
+
* https://github.com/OpenWonderLabs/SwitchBotAPI
|
|
10
8
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
9
|
+
* Capability matrix (derived from OpenAPI v1.1):
|
|
10
|
+
* - S1 / S1 Plus / K10+ / K10+ Pro
|
|
11
|
+
* • Commands: start, stop, dock, PowLevel {0-3}
|
|
12
|
+
* • No pause/resume, no mop, no area selection
|
|
13
|
+
* - K10+ Pro Combo
|
|
14
|
+
* • Commands: startClean {action: sweep|mop, param: {fanLevel 1-4}}, pause, dock
|
|
15
|
+
* • changeParam {fanLevel}, setVolume
|
|
16
|
+
* - S10 / S20 / K11+ / K20+ Pro
|
|
17
|
+
* • Commands: startClean {action: sweep|sweep_mop|mop (model-dependent), param: {fanLevel 1-4, waterLevel 1-2?}},
|
|
18
|
+
* pause, dock, changeParam, setVolume, (S10/S20) selfClean/addWaterForHumi
|
|
19
|
+
* • Some models support waterLevel, some do not (e.g. K10+ Pro Combo)
|
|
16
20
|
*
|
|
17
|
-
*
|
|
18
|
-
* -
|
|
19
|
-
* -
|
|
20
|
-
*
|
|
21
|
-
* -
|
|
21
|
+
* Matter clusters exposed:
|
|
22
|
+
* - rvcRunMode: Idle/Cleaning only (no Mapping mode via OpenAPI)
|
|
23
|
+
* - rvcCleanMode: Interpreted per model:
|
|
24
|
+
* • Basic vac (S1/K10 family): suction levels → Quiet/Standard/Strong/MAX
|
|
25
|
+
* • Mop-capable (K10+ Pro Combo/K11+/K20+ Pro): action → Vacuum or Mop
|
|
26
|
+
* • Mop+Vac-capable (S10/S20): action → Vacuum or Vacuum & Mop
|
|
27
|
+
* - rvcOperationalState: start/stop/pause/goHome handlers are attached only when supported
|
|
28
|
+
* - serviceArea: NOT exposed (area/room selection isn’t in public OpenAPI)
|
|
22
29
|
*/
|
|
23
30
|
import type { API, Logger } from 'homebridge';
|
|
24
31
|
import { BaseMatterAccessory } from './BaseMatterAccessory.js';
|
|
25
32
|
export declare class RoboticVacuumAccessory extends BaseMatterAccessory {
|
|
26
|
-
private
|
|
33
|
+
private currentCleanAction;
|
|
34
|
+
private currentFanLevel;
|
|
35
|
+
private capabilities;
|
|
27
36
|
constructor(api: API, log: Logger, opts?: Partial<import('./BaseMatterAccessory').BaseMatterAccessoryConfig & {
|
|
28
37
|
deviceId?: string;
|
|
29
38
|
}>);
|
|
@@ -34,43 +43,11 @@ export declare class RoboticVacuumAccessory extends BaseMatterAccessory {
|
|
|
34
43
|
private handleStart;
|
|
35
44
|
private handleResume;
|
|
36
45
|
private handleGoHome;
|
|
37
|
-
private handleSelectAreas;
|
|
38
|
-
private handleSkipArea;
|
|
39
|
-
/**
|
|
40
|
-
* Helper method to clear all active timers
|
|
41
|
-
*/
|
|
42
|
-
private clearTimers;
|
|
43
|
-
/**
|
|
44
|
-
* Helper method to initiate return to dock sequence
|
|
45
|
-
* Can be called synchronously from other handlers
|
|
46
|
-
*/
|
|
47
|
-
private returnToDock;
|
|
48
|
-
/**
|
|
49
|
-
* Update Methods - Use these to update the vacuum state from your API/device
|
|
50
|
-
*
|
|
51
|
-
* Since this is a platform accessory, state updates work immediately after registration.
|
|
52
|
-
*/
|
|
53
46
|
updateOperationalState(state: number): void;
|
|
54
47
|
updateRunMode(mode: number): void;
|
|
55
48
|
updateCleanMode(mode: number): void;
|
|
56
|
-
updateSelectedAreas(areaIds: number[]): void;
|
|
57
|
-
updateCurrentArea(areaId: number | null): void;
|
|
58
|
-
updateProgress(progress: Array<{
|
|
59
|
-
areaId: number;
|
|
60
|
-
status: number;
|
|
61
|
-
}>): void;
|
|
62
49
|
/**
|
|
63
|
-
* Update battery percentage
|
|
64
|
-
*
|
|
65
|
-
* Note: The Matter specification for RoboticVacuumCleaner does not include
|
|
66
|
-
* the PowerSource cluster. Battery information for robotic vacuums should be
|
|
67
|
-
* communicated through device-specific status reporting or via the RVC
|
|
68
|
-
* operational state cluster.
|
|
69
|
-
*
|
|
70
|
-
* This method is retained for API compatibility but does not update any
|
|
71
|
-
* Matter cluster state.
|
|
72
|
-
*
|
|
73
|
-
* @param percentageOrBatPercentRemaining - Battery percentage (0-100) or batPercentRemaining (0-200)
|
|
50
|
+
* Update battery percentage (no PowerSource cluster for this device type)
|
|
74
51
|
*/
|
|
75
52
|
updateBatteryPercentage(percentageOrBatPercentRemaining: number): Promise<void>;
|
|
76
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RoboticVacuumAccessory.d.ts","sourceRoot":"","sources":["../../src/devices-matter/RoboticVacuumAccessory.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"RoboticVacuumAccessory.d.ts","sourceRoot":"","sources":["../../src/devices-matter/RoboticVacuumAccessory.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAkB,MAAM,YAAY,CAAA;AAE7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAwH9D,qBAAa,sBAAuB,SAAQ,mBAAmB;IAE7D,OAAO,CAAC,kBAAkB,CAA4C;IACtE,OAAO,CAAC,eAAe,CAAmB;IAC1C,OAAO,CAAC,YAAY,CAAoB;gBAE5B,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC,OAAO,uBAAuB,EAAE,yBAAyB,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;YAuFtH,mBAAmB;YAYnB,qBAAqB;YA6CrB,WAAW;YAYX,UAAU;YAmBV,WAAW;YAwBX,YAAY;YAKZ,YAAY;IAanB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAc3C,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAMjC,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAa1C;;OAEG;IACU,uBAAuB,CAAC,+BAA+B,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAoB7F"}
|