import { DpValue } from '../../../types'; export type BindParams = { /** * 设备 ID,默认从默认设备环境中取 */ devId?: string; /** * 功能点 ID,需搭配 dpValue 一同使用, * 其含义为当设备上报后满足 dpId == dpValue 时,则会自动触发执行对应绑定的一键执行 */ dpId: string; /** * 功能点值,需搭配 dpId 一同使用, * 其含义为当设备上报后满足 dpId == dpValue 时,则会自动触发执行对应绑定的一键执行 */ dpValue: DpValue; /** * 需要绑定的场景 id 列表,在 dpId == dpValue 时,则会触发执行当前规则 id 对应绑定的联动 */ ruleId: string; /** * 名称 */ name?: string; /** * 图标 */ icon?: string; /** * 家庭 id,不填默认使用当前 App 家庭 id */ gid?: string; }; /** * 一键执行查询参数 */ export type TapToRunQueryParams = { /** * 设备 ID,不传则使用当前设备 */ devId?: string; /** * 家庭 ID,不传则使用当前 App 家庭 */ gid?: string; /** * 是否包含标准 Zigbee 场景 */ containStandardZigBee?: boolean; }; export type TriggerTapToRunParams = { /** * 规则 ID,可通过已绑定的一键执行列表中的 triggerRuleId 获取 */ ruleId: string; }; /** * 一键执行解绑参数 */ export type UnbindTapToRunParams = { /** * 可通过已绑定的一键执行列表中的 bindId 获取 */ bindId: string; /** * 家庭 ID,不传则使用当前 App 家庭 */ gid?: string; }; /** * 一键执行动作项 */ export type TapToRunAction = { /** * 执行动作的显示名称 */ actionDisplay: string; /** * 执行动作的执行者 */ actionExecutor: string; /** * 执行动作的执行策略 */ actionStrategy: string; /** * 动作所属实体 ID */ entityId: string; /** * 修改时间戳 */ gmtModified: number; /** * 动作唯一 ID */ id: string; /** * 动作顺序号 */ orderNum: number; /** * 规则 ID */ ruleId: string; /** * 动作状态 */ status: boolean; }; /** * 可绑定的一键执行规则 */ export type TapToRunRule = { /** * 执行动作列表 */ actions: TapToRunAction[]; /** * 背景图地址 */ background?: string; /** * 面板绑定 */ boundForPanel?: boolean; /** * WiFi 面板绑定 */ boundForWiFiPanel?: boolean; /** * 图标 */ coverIcon?: string; /** * 背景颜色 */ displayColor?: string; /** * 规则是否启用 */ enabled: boolean; /** * 执行规则 ID */ id: string; /** * 联动名称或备注 */ name: string; }; /** * 可绑定的一键执行规则列表 */ export type TapToRunRules = TapToRunRule[]; /** * 已绑定的一键执行目标规则 */ export type BindTapToRunLinkedRule = TapToRunRule & { /** * 规则类型 */ ruleType?: number; /** * 规则是否启用 */ triggerRuleEnable?: boolean; /** * 执行规则 ID,一般用来进行触发 */ triggerRuleId?: string; }; /** * 已绑定的一键执行项 */ export type BindTapToRunRule = { /** * 关联实体 ID,格式为 dpId#dpValue */ associativeEntityId: string; /** * 关联实体的值列表 */ associativeEntityValueList: BindTapToRunLinkedRule[]; /** * 绑定 ID */ bindId: number; /** * 业务域,一键执行固定为 wirelessSwitchBindScene */ bizDomain: string; /** * 是否启用 */ enable: boolean; /** * 源设备 ID */ sourceEntityId: string; }; /** * 已绑定的一键执行联动规则列表 */ export type BindTapToRunRules = BindTapToRunRule[]; /** * 一键执行触发结果 */ export type TriggerTapToRunResult = boolean; /** * 一键执行绑定结果 */ export type BindTapToRunResult = { /** * 关联实体 ID,格式为 dpId#dpValue */ associativeEntityId: string; /** * 关联的规则 ID */ associativeEntityValue: string; /** * 绑定 ID,一般用来解绑 */ bindId: number; /** * 业务域,一键执行固定为 wirelessSwitchBindScene */ bizDomain: string; /** * 数据 ID */ id: number; /** * 家庭 ID */ ownerId: string; /** * 设备 ID */ sourceEntityId: string; /** * 触发规则 ID */ triggerRuleId: string; }; /** * 一键执行解绑结果 */ export type UnbindTapToRunResult = boolean;