@ray-js/robot-data-stream 0.0.17-beta.4 → 0.0.17-beta.5

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.
@@ -3,15 +3,15 @@ import type { BaseResponse } from './base';
3
3
  export type CruiseCmd = 'start' | 'pause' | 'resume' | 'stop';
4
4
  /** 巡航状态:idle 未巡航 / cruising 巡航中 / paused 已暂停 */
5
5
  export type CruiseStatus = 'idle' | 'cruising' | 'paused';
6
- /** 巡航类型:whole_house 全屋巡航 / select_room 定点巡航(按房间工作点) */
7
- export type CruiseType = 'whole_house' | 'select_room';
6
+ /** 巡航类型:whole_house 全屋巡航 / spot 定点巡航(按净化点坐标) */
7
+ export type CruiseType = 'whole_house' | 'spot';
8
8
  export interface SetCruiseData {
9
9
  /** start 开始 / pause 暂停 / resume 继续 / stop 结束 */
10
10
  cmd: CruiseCmd;
11
11
  /** 巡航类型,cmd 为 start 时必填 */
12
12
  cruiseType?: CruiseType;
13
- /** select_room 时的房间 ID 列表;不传表示全部工作点 */
14
- ids?: number[];
13
+ /** spot 定点巡航时的净化点坐标列表,格式 "x, y";不传表示全部净化点 */
14
+ polygons?: string[];
15
15
  version?: string;
16
16
  }
17
17
  export interface RequestCruiseData {
@@ -23,12 +23,10 @@ export interface CruiseResponse extends BaseResponse {
23
23
  mapId: number;
24
24
  /** 巡航类型;idle 时可不携带 */
25
25
  cruiseType?: CruiseType;
26
- /** select_room 时本次巡航的房间 ID 列表 */
27
- ids?: number[];
28
- /** 当前正在工作的房间 ID */
29
- currentId?: number;
30
- /** 当前工作点坐标 "x, y" */
31
- polygon?: string;
26
+ /** spot 定点巡航时的净化点坐标列表,格式 "x, y" */
27
+ polygons?: string[];
28
+ /** 当前正在净化的坐标 "x, y" */
29
+ currentPolygon?: string;
32
30
  }
33
31
  export type TRequestCruise = (message?: RequestCruiseData) => Promise<CruiseResponse>;
34
32
  export type TSetCruise = (message: SetCruiseData) => Promise<CruiseResponse>;
@@ -1,6 +1,12 @@
1
1
  import type { BaseResponse } from './base';
2
- /** 工作类型:select_room 选房净化 / whole_house 整屋净化 */
3
- export type PurifierWorkType = 'select_room' | 'whole_house';
2
+ /**
3
+ * 工作类型:
4
+ * - select_room 选房净化(携带 ids)
5
+ * - whole_house 整屋净化
6
+ * - spot 定点净化
7
+ * - current_location 原地净化
8
+ */
9
+ export type PurifierWorkType = 'select_room' | 'whole_house' | 'spot' | 'current_location';
4
10
  /** 风速档位,透传字符串,不限制具体取值(不同设备支持的档位不同) */
5
11
  export type PurifierFanMode = string;
6
12
  export interface PurifierScheduleItem {
@@ -10,9 +16,9 @@ export interface PurifierScheduleItem {
10
16
  cycle: number[];
11
17
  /** 执行时间 [时, 分],24 小时制 */
12
18
  time: number[];
13
- /** 房间 ID 列表;workTypes 为 whole_house 时为空数组 */
19
+ /** 房间 ID 列表;workTypes 为 whole_house / spot / current_location 时为空数组 */
14
20
  ids: number[];
15
- /** 工作类型,与 ids 对齐;整屋时单元素 whole_house */
21
+ /** 工作类型,与 ids 对齐;非 select_room 时为单元素 */
16
22
  workTypes: PurifierWorkType[];
17
23
  /** 风速,与 ids 对齐(整屋时单元素) */
18
24
  fanModes: PurifierFanMode[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/robot-data-stream",
3
- "version": "0.0.17-beta.4",
3
+ "version": "0.0.17-beta.5",
4
4
  "description": "扫地机P2P数据流标准化组件",
5
5
  "main": "lib/index",
6
6
  "files": [