/** * 与面板/设备建立绑定关系,通常为设备ID、DP点、群组、规则,dpId#value等 */ type AssociativeEntityId = string; /** * 当associativeEntityId不足以区分情况下使用,通常可关联设备、DP值、群组、规则等 */ type AssociativeEntityValue = string; export interface Scene { dpId: number; bindType: number; /** * 按键ID */ btnId: number; devId: string; /** * 触发条件 */ dpValue: string; /** * 规则ID */ ruleId: string; gwId?: string; localSid?: string; ruleBackground?: string; actionExcutor?: string[]; condRuleId?: string; ruleName?: string; } export interface Bill { devId: string; unit: string; notificationStatus: boolean; price: number; billType: number; threshold: number; position: string; cycle: string; } export interface Automation { attribute: number; auditStatus: number; background: string; boundForPanel: boolean; boundForWiFiPanel: boolean; code: string; commonField: string; coverIcon: string; disableTime: number; displayColor: string; enabled: boolean; gmtCreate: number; gmtModified: number; id: string; iotAutoAlarm: boolean; localLinkage: boolean; logicRule: boolean; matchType: number; name: string; newLocalScene: boolean; ownerId: string; ruleSource: number; ruleType: number; scenarioRule: boolean; stickyOnTop: boolean; uid: string; } export interface AlarmList { /** * 审核状态 */ auditStatus: number; /** * 是否被场景面板绑定 */ boundForPanel: boolean; /** * 是否被 WIFI 场景面板绑定 */ boundForWiFiPanel: boolean; /** * 是否启用 */ enabled: boolean; /** * 多语言数据体 */ i18nData: { /** * 名称 */ name: { /** * 英文名称 */ en: string; /** * 中文名称 */ zh: string; }; /** * 内容 */ content: { /** * 英文内容 */ en: string; /** * 中文内容 */ zh: string; }; }; /** * 规则 ID */ id: string; /** * 是否为 IoT 自动告警 */ iotAutoAlarm: boolean; /** * 是否为逻辑规则 */ isLogicRule: boolean; /** * 是否为本地联动 */ localLinkage: boolean; /** * 规则名称 */ name: string; /** * 是否为 APP 管控本地联动 */ newLocalScene: boolean; /** * 场景是否显示在首页 */ stickyOnTop: boolean; } export interface ISelectedScene { devId: string; dpId: string | number; dpValue: string | number | boolean; btnId: string; ruleId: string; } export interface IBindScene { devId: string; btnId: string; } export interface IAndSingleTime { bizId: string; bizType: string; actions: any; loops?: string; category?: string; status?: number; isAppPush?: boolean; aliasName?: string; } export interface IQueryTimerTasks { bizId: string; bizType: string; category: string; } export type Timers = Array<{ /** * 初始化状态,0:关闭;1:开启。 */ status: number; /** * 在0000000基础上,把所选择日期对应位置的 0 改成 1,第一位表示周日。 */ loops: string; /** * 定时时间。 */ time: string; /** * 定时任务主键。 */ id: number; /** * 是否发送执行通知。 */ isAppPush: boolean; /** * DP 值。 */ dps: string; /** * 分组定时排序。 */ groupOrder: number; /** * 分组定时 ID。 */ groupId: string; /** * 分组定时定时备注。 */ aliasName: string; }>; export interface IQueryTimerTasksResponse { /** * 定时分类状态 */ categoryStatus: number; /** * 定时任务 ID */ id: string; /** * 定时分类 */ category: string; /** * 见Timers */ timers: Timers[]; } export interface IModifySingleTimer { bizId: string; bizType: string; id: string | number; actions: any; loops?: string; status?: number; isAppPush?: boolean; aliasName?: string; } export interface IAndGroupTimer { bizId: string; bizType: string; actionsArray: any; loops?: string; category?: string; status?: number; isAppPush?: boolean; aliasName?: string; } export interface IModifyGroupTimer { bizId: string; bizType: string; actionsArray: any; loops?: string; status?: number; isAppPush?: boolean; aliasName?: string; } export interface IModDeleteTaskByIds { bizId: string; bizType: string; ids: string; status: number; } export interface IModDeleteTaskByCategory { bizId: string; bizType: string; category: string; status: number; } export interface IGetDpLastTimer { bizId: string; type: string; instruct?: string; } export interface IGetDpLastTimerResponse { /** * 定时时间 */ time: string; /** * 定时任务状态,0:关闭,1:开启,2:无效/已删除 */ status: number; /** * 定制类项目标识 */ project: number; /** * 定时动作 */ actionStr: string; /** * 分组定时排序 */ groupOrder: number; /** * 修改时间 */ gmtModified: number; /** * 创建时间 */ gmtCreate: number; /** * 设备 UUID */ uuid: string; /** * 定时运行模式,0:云端定时,1:本地定时 */ runMode: number; /** * 设备 ID */ devId: string; /** * 定时任务 ID */ id: number; /** * 日期 */ date: string; /** * 时区 */ timeZone: string; /** * UID */ uid: string; /** * 时区 ID */ timezoneId: string; /** * 资源类型。0:单设备;1:群组设备。 */ bizType: any; /** * action中的value */ value: any; /** * 分组定时 ID */ groupId: string; /** * 周循环 */ loops: string; /** * 定时类型,0:普通定时,5:天文定时 */ timerType: number; /** * 定时业务分类,不同业务方使用不同的 categoryId 做区分 */ categoryId: string; } export interface IGetLastTimerPeriod { devId: string; instruct?: string; } export interface IGetLastTimerPeriodResponse { /** * 定时分类状态。 */ categoryStatus: number; /** * 定时任务 ID。 */ id: string; /** * 定时分类。 */ category: string; /** * 见Timers。 */ timers: Timers[]; } export interface IGetAstronomicalList { /** * 设备 ID 或群组 ID */ bizId: string; } export interface IGetAstronomicalListResponse { /** * 日出日落类型 */ astronomicalType: number; /** * 设备或群组 ID */ bizId: string; /** * 资源类型。0:单设备。1:群组设备。 */ bizType: number; /** * DP 值 */ dps: string; /** * 定时任务 ID */ id: number; /** * 经度 */ lat: number; /** * 纬度 */ lon: number; /** * 周循环 */ loops: string; /** * 下一个日出时间 */ nextSunSet: string; /** * 定时偏移执行类型 */ offsetType: number; /** * 定时任务状态,0 关闭,1 开启,2 无效/已删除 */ status: number; /** * 定时时间 */ time: string; /** * 时区 */ timezone: string; } export interface IAstronomical { /** * 定时任务 ID */ id: number; /** * 设备或群组 ID */ bizId: string; /** * 资源类型。0:单设备。1:群组设备。 */ bizType: number; /** * 周循环 */ loops: string; /** * DP 值 */ dps: string; /** * 日出日落类型 */ astronomicalType: number; /** * 时区 */ timezone: string; /** * 定时日期 yyyyMMdd */ date: string; /** * 定时时间 */ time: string; /** * 定时偏移执行类型 */ offsetType: number; /** * 经度 */ lat: number; /** * 纬度 */ lon: number; } export interface IUpdateAstronomicalStatus { /** * 定时任务 ID */ id: string; /** * 0:关闭。1:开启 */ status: number; } export interface IRemoveAstronomicalParams { /** 天文定时 ID */ id: string; } export interface IUpdateBillConfigure { devId: string; unit: number; notificationStatus: boolean; threshold: number; cycle: string; position: string; price: number; billType: number; } export interface IGetDpsInfos { /** * 网关 ID,直连设备值同 devId,子设备则传网关的设备 ID */ gwId: string; /** * 设备 ID */ devId: string; } export interface IGetDpsInfosResponse { /** * DP Code */ code: string; /** * DP ID */ dpId: number; /** * DP 值 */ value: string; /** * DP 名称 */ name: string; /** * DP 最近上报时间 */ time: number; /** * DP 类型 */ type: string; } export interface IUpdateDpName { /** * 设备 ID */ devId: string; /** * DP ID */ dpId: string; /** * DP 自定义名称 */ name: string; /** * 网关 ID,可不传 */ gwId?: string; } export interface IGetGroupDpsInfosResponse { /** * DP Code */ code: string; /** * DP ID */ dpId: number; /** * DP 值 */ value: string; /** * DP 名称 */ name: string; /** * DP 最近上报时间 */ time: number; /** * DP 类型 */ type: string; } export interface IUpdateGroupDpName { /** * 群组 ID */ group: string; /** * DP ID */ dpId: string; /** * DP 自定义名称 */ name: string; } /** * 获取天气及空气质量请求参数 */ export interface IGetWeatherQuality { /** * 设备 ID */ devId: string; /** * 是否查询本地天气 */ isLocal: boolean; } export interface IGetWeatherQualityResponse { /** * 城市列表 * */ c: Array<{ /** * 城市名称 */ name: string; /** * 城市 ID */ id: number; }>; /** * 天气及空气质量信息 */ w: Array<{ /** * 风向 */ windDir: string; /** * 概述 */ tips: string; /** * 体感温度 */ realFeel: number; /** * 二氧化氮 */ no2: number; /** * 二氧化硫 */ so2: number; /** * 时区 */ zoneId: string; /** * 空气湿度 */ humidity: number; /** * 风速,国内外都是 m/s */ windSpeed: string; /** * 温度 ,国内外都是单位摄氏度 */ temp: number; /** * 臭氧 */ o3: number; /** * PM10 */ pm10: number; /** * 大气气压 */ pressure: number; /** * 一氧化碳 */ co: number; /** * 空气质量评分等级 */ qualityLevel: number; /** * 空气质量评分 */ quality: string; /** * 天气文本描述 */ condition: string; /** * PM25 */ pm25: number; /** * 天气图标地址 */ condIconUrl: string; /** * 空气质量 */ aqi: number; /** * 天气文本编号 */ conditionNum: string; /** * 日出时间文本 */ sunRise: string; /** * 日落时间文本 */ sunSet: string; /** * 日落时间戳 */ sunSetTimestamp: number; /** * 日出时间戳 */ sunRiseTimestamp: number; }>; } /** * 获取天气预报请求参数 */ export interface IGetWeathers { /** * 设备 ID */ devId: string; /** * 预报天数(默认值为 7,最大可预报天数为 7) */ dataRange?: number; } export interface IGetWeathersResponse { /** * 城市信息 */ c: Array<{ /** * 城市名称 */ name: string; /** * 城市 ID */ id: number; }>; /** * 天气预报数据 */ weathers: Array<{ /** * 风向 */ temp: number; /** * 日落文本 */ thigh: number; /** * 概述 */ pressure: number; /** * 体感温度 */ condition: string; /** * 二氧化氮 */ tlow: number; /** * 降雨概率,单位% */ pop: number; /** * 降水量,单位毫米 */ qpf: number; /** * 日落时间戳 */ condIconUrl: string; /** * 空气湿度 */ humidity: number; /** * 天气文本编号 */ conditionNum: string; /** * 风速,国内外都是 m/s */ windSpeed: string; /** * 风向 */ windDir: string; /** * 风速等级 */ windLevel: number; /** * 时区 */ zoneId: string; /** * 日出时间文本 */ sunRise: string; /** * 日落时间文本 */ sunSet: string; /** * 日落时间戳 */ sunSetTimestamp: number; /** * 日出时间戳 */ sunRiseTimestamp: number; }>; } export interface ISaveCustomizePosition { /** * 设备 ID */ devId: string; /** * 经度 */ lon: string; /** * 纬度 */ lat: string; /** * 位置名称(目前没用,不影响天气返回结果) */ locationName?: string; } export interface IGetCustomizePosition { /** * 设备 ID */ devId: string; } export interface IGetCustomizePositionResponse { /** * 经度 */ lon: string; /** * 纬度 */ lat: string; } /** * 获取指定时间段上报日志请求参数 */ export interface IGetLogInSpecifiedTime { /** * 设备 ID */ devId: string; /** * DP 点 ID,多个 ID 用英文逗号隔开 */ dpIds: string; /** * 分页偏移量 */ offset: number; /** * 每页数量,最大值上限为 1000 */ limit: number; /** * 排序方式:'DESC' 倒序(默认)或 'ASC' 顺序 */ sortType?: 'DESC' | 'ASC'; /** * 查询起始时间戳(毫秒) */ startTime?: string; /** * 查询结束时间戳(毫秒) */ endTime?: string; } export type Dp = { /** * 上报数据的时间戳格式 */ timeStamp: number; /** * dp点的id */ dpId: number; /** * 根据设备时区转换后的时间格式 yyyy-MM-dd HH:mm:ss */ timeStr: string; /** * dp点的值 */ value: string; }; export interface IGetLogInSpecifiedTimeResponse { /** * 总数据 */ total: number; /** * 见Dp */ dps: Dp[]; /** * 是否有下一页 */ hasNext: boolean; } /** * 获取 DP 点上报日志请求参数 */ export interface IGetDpReportLog { /** * 设备 ID */ devId: string; /** * DP 点 ID,多个 ID 用英文逗号隔开 */ dpIds: string; /** * 分页偏移量 */ offset: number; /** * 每页数量,最大值上限为 1000 */ limit: number; /** * 排序方式:'DESC' 倒序(默认)或 'ASC' 顺序 */ sortType?: 'DESC' | 'ASC'; } export interface IGetDpReportLogResponse { /** * 总条数 */ total: number; /** * 见Dp */ dps: Dp[]; /** * 是否有下一页 */ hasNext: boolean; } /** * 获取 DP 点每日统计数据请求参数 */ export interface IGetDpLogDays { /** * 设备 ID */ devId: string; /** * DP 点 ID */ dpId: string; /** * 统计类型:sum(求和)、min(最小值)或 max(最大值) */ type?: string; /** * 开始日期,格式为 yyyyMMdd,例如 20180529 */ startDay: string; /** * 结束日期,格式为 yyyyMMdd,例如 20180531 */ endDay: string; } export interface IGetDpLogDaysResponse { /** * 总条数 */ total: string; /** * 每天对应的值 */ values: string[]; /** * 天的集合 */ days: string[]; } export interface IGetDpResultByMonth { devId: string; dpId: string; type: 'sum' | 'minux' | 'mac'; } export interface IGetDpResultByMonthResponse { [date: string]: string; } export interface IGetDpResultByHour { devId: string; dpId: string; date: string; uid?: string; auto?: number; type: 'sum' | 'minux' | 'avg'; } export interface IGetDpResultByHourResponse { [date: string]: string; } export interface IGetDataWithSpecified { devId: string; dpId: string; startDay: string; endDay: string; uid?: string; auto?: number; type: 'sum' | 'minux' | 'avg'; } export interface IGetDataWithSpecifiedResponse { result: { [date: string]: string; }; min: string; } export interface IGetWeekWithSpecified { devId: string; dpId: string; startWeek: string; endWeek: string; type: 'sum' | 'minux' | 'avg'; } export interface IGetWeekWithSpecifiedResponse { result: { [date: string]: string; }; min: string; } export interface IGetMonthWithSpecified { devId: string; dpId: string; startMonth: string; endMonth: string; uid?: string; auto?: number; type: 'sum' | 'minux' | 'avg'; } export interface IGetMonthWithSpecifiedResponse { [date: string]: string; } export interface IGetMultiDpsAllResult { devId: string; dpIds: string; startTime: string; endTime: string; reverse?: number; rowType?: number; startRowKey?: string; endRowKey?: string; size?: number; } export interface IGetMultiDpsAllResultResponse { /** * dp点的id */ dpId: number; /** * 数据库唯一id */ rowkey: string; /** * 时间戳格式的时间 */ timeStamp: number; /** * 转换后的时间格式 yyyy-MM-dd HH:mm:ss */ timeStr: string; /** * dp点的值 */ value: string; } /** * 设置告警开关请求参数 */ export interface ISetAlarmSwitch { /** * 设备 ID */ devId: string; /** * 要开启或关闭的告警规则 ID,多个 ID 用英文逗号隔开 */ ruleIds: string; /** * 是否禁用告警,'true' 表示禁用,'false' 表示启用 */ disabled: string; } export interface IAlarmSdk { getDevAlarmList: any; setAlarmSwitch: any; } export interface IGetLinkageDeviceList { /** 家庭 ID */ gid: number; /** 请求类型 */ sourceType: string; } export interface ILinkageDevice { /** 设备品类 */ category: string; /** 设备 DP 点列表 */ datapoints: any[]; /** 设备 ID */ devId: string; /** 设备图标地址 */ iconUrl: string; /** 设备名称 */ name: string; /** 产品 ID */ productId: string; } export interface ISceneListItem { /** 执行动作 */ actions: any[]; /** 属性 */ attribute: number; /** 审核状态 */ auditStatus: number; /** 背景图地址 */ background: string; /** 面板绑定 */ boundForPanel: boolean; /** WiFi 面板绑定 */ boundForWiFiPanel: boolean; /** 规则 code */ code: string; /** 通用字段 */ commonField: string; /** 图标 */ coverIcon: string; /** 禁用时间 */ disableTime: number; /** 背景颜色 */ displayColor: string; /** 规则是否启用 */ enabled: true; /** 设备 ID */ devId: string; /** 联动名称 */ name: string; /** 执行规则 ID */ id: string; } export interface ISceneAction { /** * 执行动作的显示名称 */ actionDisplay: string; /** * 执行动作的执行者 */ actionExecutor: string; /** * 执行动作的策略 */ actionStrategy: string; /** * 属性值 */ attribute: number; /** * 设备删除标记,表示设备是否被删除 */ devDelMark: boolean; /** * 动作是否启用 */ enabled: boolean; /** * 实体ID,表示动作所属的实体的ID */ entityId: string; /** * 修改时间戳 */ gmtModified: number; /** * 动作的唯一ID */ id: string; /** * 网关同步标记,表示是否网关同步 */ offGwSync: boolean; /** * 动作的顺序号 */ orderNum: number; /** * 规则ID,表示动作所属的规则的ID */ ruleId: string; /** * 动作状态 */ status: boolean; /** * 用户ID,表示动作所属的用户的ID */ uid: string; } /** * 一键执行类型的联动规则数据 */ export interface ISceneListItemV2 { /** * 执行动作 */ actions: ISceneAction[]; /** * 是否为告警问题 */ alarmIssue: boolean; /** * 属性 * 根据枚举值的2次幂进行位运算 */ attribute: number; /** * 审核状态 * 0. 未审核 * 1. 审核通过 * 2. 审核不通过 */ auditStatus: number; /** * 背景图地址 */ background?: string; /** * 面板绑定 */ boundForPanel: boolean; /** * WiFi 面板绑定 */ boundForWiFiPanel: boolean; /** * 规则 code */ code: string; /** * 通用json字段,比如本地联动会存网关id,gwId */ commonField: string; /** * 是否包含已删除的设备 */ containDeviceDelete: boolean; /** * 图标 */ coverIcon: string; /** * 规则描述 */ description?: string; /** * 禁用时间戳 */ disableTime?: number; /** * 背景颜色 */ displayColor: string; /** * 规则是否启用 */ enabled: boolean; /** * 是否强制云端触发 */ forceCloudTrigger: boolean; /** * 执行规则 id */ id: string; /** * 是否为 IoT 自动告警 */ iotAutoAlarm: boolean; /** * 是否为告警问题 */ isAlarmIssue: boolean; /** * 是否为逻辑规则 */ isLogicRule: boolean; /** * 联动类型 */ linkageType: number; /** * 是否本地联动 */ localLinkage: boolean; /** * 是否逻辑规则 */ logicRule: boolean; /** * 匹配类型 * 1. 任意条件,多个条件里只要有一个即触发(即 或关系)。 * 2. 全部满足,多个条件全部满足才触发。 * 3. 表态式匹配, 根据 rule 字段的 expr 确定是否满足,条件满足时触发。 */ matchType: number; /** * 联动名称或备注 */ name: string; /** * 是否需要清理 gidSid */ needCleanGidSid: boolean; /** * 是否需要校验不在工作时间段 */ needValidOutOfWork: boolean; /** * 是否为新本地场景 */ newLocalScene: boolean; /** * 是否离网关同步 */ offGwSync: boolean; /** * 离网关同步是否成功 */ offGwSyncSuccess: boolean; /** * 排序权重 */ orderWeight: number; /** * 不在工作时间段标记 */ outOfWork: number; /** * 家庭 id */ ownerId: string; /** * 面板类型 */ panelType: number; /** * 权限 code */ permissionCode: string; /** * 规则体裁 */ ruleGenre: number; /** * 规则来源 */ ruleSource: number; /** * 规则类型 * 1. 系统定义 * 2. 商家定义 * 3. 用户定义 * 4. 安防规则 * 5. 服务定义(如 dp 点转发) */ ruleType: number; /** * 运行环境 */ runtimeEnv: string; /** * 是否为场景规则 */ scenarioRule: boolean; /** * 规则状态 */ status: boolean; /** * 状态条件列表 */ statusConditions: any[]; /** * 是否显示在首页顶部 */ stickyOnTop: boolean; /** * 子匹配类型 */ subMatchType: number; /** * 用户 id */ uid: string; } export interface IBindRule { /** 设备 ID */ devId: string; /** * 与面板/设备建立绑定关系,通常为设备ID、DP点、群组、规则,dpId#value等 */ sourceEntityId?: string; /** * 当associativeEntityId不足以区分情况下使用,通常可关联设备、DP值、群组、规则等 */ associativeEntityId: AssociativeEntityId; /** 关联场景 ID */ ruleId: string; /** 关联 DP 点 */ entitySubIds: string; /** 关联 DP 点、动作组合 */ expr: [string[]]; /** 业务域 */ bizDomain: string; /** 家庭 ID */ gid: string; /** * 拓展字段,非必传 */ property?: Record; } export interface IBindRuleResponse { /** * 与面板/设备建立绑定关系,通常为设备ID、DP点、群组、规则,dpId#value等 */ associativeEntityId: AssociativeEntityId; /** * 当associativeEntityId不足以区分情况下使用,通常可关联设备、DP值、群组、规则等 */ associativeEntityValue: AssociativeEntityValue; /** * 业务域 */ bizDomain: string; /** * 数据 ID */ id: number; /** * 家庭 ID */ ownerId: string; /** * 设备 ID */ sourceEntityId: string; /** * 规则 ID */ triggerRuleId: string; /** * 执行动作设备信息 */ triggerRuleVO: any; } /** * 实体类型枚举 */ declare enum EntityType { /** 关联实体为设备 */ DEVICE = 1, /** 关联实体为联动规则 */ RULE = 2 } export interface IGetBindRuleList { /** 业务域 */ bizDomain: string; /** 设备 ID */ devId: string; /** 与面板/设备建立绑定关系标识 */ sourceEntityId?: string; /** 实体类型,1 为设备,2 为联动规则 */ entityType: EntityType; /** 家庭 ID */ gid: string; } /** * 绑定规则关联的场景项 */ export interface IBindRuleSceneItem extends ISceneListItemV2 { /** * 无线开关规则是否启用 */ triggerRuleEnable: boolean; /** * 无线开关执行规则 id */ triggerRuleId: string; } export interface IBindRuleListItem { /** * 与面板/设备建立绑定关系,通常为设备ID、DP点、群组、规则,dpId#value等 */ associativeEntityId: AssociativeEntityId; /** * 关联实体的值列表 */ associativeEntityValueList: IBindRuleSceneItem[]; /** * 绑定 id,一般用来解绑 */ bindId: number; /** * 业务域 */ bizDomain: string; /** * 是否启用 */ enable: boolean; /** * 设备 ID */ sourceEntityId: string; } export interface IUnbindRule { /** * 绑定 ID */ bindId: string; /** * 家庭 ID */ gid: string; } export interface IRemoveRule { /** 业务域 */ bizDomain: string; /** 与面板/设备建立绑定关系标识 */ sourceEntityId?: string; /** 设备 ID */ devId: string; /** 绑定关系标识 */ associativeEntityId: AssociativeEntityId; /** 规则 ID */ associativeEntityValue: AssociativeEntityValue; /** 家庭 ID */ gid: string; } export interface IGetDevProperty { /** * 设备 ID */ devId: string; /** * 业务类型(自定义) */ bizType: number; /** * 设备自定义属性 key */ code: string; } export interface IDevPropertyItem { /** * 业务类型 */ bizType: number; /** * 设备自定义属性 key */ code: string; /** * 设备 ID */ devId: string; /** * 创建时间 */ gmtCreate: number; /** * 修改时间 */ gmtModified: number; /** * 唯一标识 */ id: string; /** * 保存设备属性时的配置规则 */ type: string; /** * 属性值 */ value: string; } export type IGetDevPropertyResponse = IDevPropertyItem[]; export interface ISaveDevProperty { /** * 设备 ID */ devId: string; /** * 业务类型(自定义) */ bizType: number; /** * 设备自定义属性列表,string 结构详见 @type{DeviceProperty} */ propertyList: string; /** * 保存设备属性的配置规则,仅针对当前写入的属性有效, * 默认在设备重置和设备重置并清除数据时均会移除 * 可以配置成 `remainAfterReset` 代表在设备重置时保留数据,仅在设备重置并清除数据时移除 */ type?: 'remainAfterReset' | string; } export interface DeviceProperty { /** * 设备自定义属性 key,最长 30 字节("device_favorite"为系统保留 code,请勿使用) */ code: string; /** * 设备自定义属性内容,最长 1024 字节 */ value: string; } export type ISaveDevPropertyResponse = boolean; export interface IGetZigbeeLocalGroupRelation { /** * 遥控器设备 ID */ devId: string; } /** * Zigbee 本地群组关系项 */ export interface IZigbeeLocalGroupRelationItem { /** * 功能点 code */ code: string; /** * 排序 */ order: number; /** * 设备端用到的群组 localId */ localId: string; /** * 面板使用的 code,用来做映射,值以 300 为前缀,例如 3001 */ categoryCode: string; } export type IGetZigbeeLocalGroupRelationResponse = { /** 遥控器群组 localId 关系列表 */ locals: IZigbeeLocalGroupRelationItem[]; }; export interface IGetZigbeeLocalGroupDeviceList { /** * 遥控器的设备 ID */ devId: string; /** * 遥控器的网关 id */ meshId: string; /** * 分组 Code,遥控器可支持多个群组,与 localId 匹配范围为 7001-7008; * localId 为云端分配,步长为 8,因此一个遥控器内部最多支持关联 8 个群组,localId 为初始值依次+1,与之匹配的 categoryCode 从 7001 依次 +1。 * 可以通过 getZigbeeLocalGroupRelation 获取 */ categoryCode: string; /** * 家庭 id,可以通过 getCurrentHomeInfo 获取 */ homeId: string; } /** * Zigbee 本地群组设备信息 */ export interface IZigbeeLocalGroupDevice { /** * 设备产品 id */ productId: string; /** * 设备 id */ devId: string; /** * 设备在线状态 */ devOnline: boolean; /** * 设备名称 */ devName: string; /** * 设备背景图片 */ iconUrl: string; /** * 是否选中 */ checked: boolean; /** * 如果是子设备,会返回子设备对应的 nodeId */ nodeId: string; /** * 网关 id */ gwId: string; /** * 网关名称 */ gwName: string; /** * 网关是否在线 */ gwOnline: boolean; } export type IGetZigbeeLocalGroupDeviceListResponse = IZigbeeLocalGroupDevice[]; export type QueryGetMessageList = { sourceIds: string[]; limit: number; offset: number; }; export interface VisionBoxMessage { msgTypeContent: string; msgContent: string; time: number; msgTitle: string; dateTime: string; attachPics: string; id: number; idStr: string; homeId: number; msgSrcId: string; businessKey: string; } export type GetMessageListRes = { pageNo: number; datas: VisionBoxMessage[]; totalCount: number; class: string; }; export type Options = { toastError?: boolean; transError?: boolean; apiName?: string; }; export type GetAiVisualMessageKey = { businessNo: string; deviceId: string; time: number; homeId: string; }; export type GetAiVisualMessageKeyRes = { businessNo: string; businessKey: string; }; export type QueryGetAiVisualReportList = { gid: string; visionBoxId: string; offset: number; limit: number; }; export declare const enum ReportType { DAILY = 1, WEEKLY = 2 } export interface EventInfo { eventOrderValue: number; eventCode: string; eventName: string; eventNum: number; eventAverageNumPerDay?: number; } export interface relatedFileList { bucket: string; filePath: string; signUrl: string; uuid: string; } export interface VisionBoxReport { visionBoxId: string; modelName: string; reportId: string; reportType: ReportType; reportTitleName: string; reportContent?: { totalEventNum: number; eventInfoList: EventInfo[]; }; summaryAndSuggestion: string; detailTitle: string; totalNumTitle: string; reportState: number; reportStateName: string; relatedFileList?: relatedFileList[]; reportKey?: string; } export type DeleteAiVisualMessageList = { msgType: number; ids?: string; msgSrcIds?: string; }; export type GetAiVisualBoxInfoParams = { stockId: string; visionBoxId?: string; gid: string; }; export declare const enum VisionEventType { PRESET = 0, CUSTOM = 1 } export declare const enum SceneType { security = 0, album = 1 } export interface VisionBoxEvent { eventCode: string; eventValue: string; eventType: VisionEventType; } export interface AiVisualBox { visionBoxId: string; visionBoxName: string; serviceStockId: string; visionBoxState: 0 | 1; generateDescState: 0 | 1; reportTypeList: ReportType[]; reportLangType: string; visionBoxEventList: VisionBoxEvent[]; sceneType: SceneType; } export interface SaveAiVisualBoxInfoParams { gid: string; stockId: string; visionBoxId?: string; visionBoxInfoContent: Omit; } export type AiVisualNeedCopyQueryParams = { stockId: string; gid: string; }; export type AiVisualNeedCopyQueryResult = { scenesType: SceneType; visionBoxId?: number; needCopyEvent: boolean; }; export type QueryGetDeviceDetailsById = { homeId: string; uuid: string; categoryCode: string; }; export declare const enum PlanStatus { USING = 1 } export declare const enum DeviceBindStatus { BINDING = 1,// 已绑定 NOT_SUPPORT = 2,// 不支持 NOT_BIND = 3 } export interface DeviceBaseInfo { icon: string; name: string; ownerId: string; uuid: string; roomName: string; deviceId: string; isBind: DeviceBindStatus; status: boolean; aiSmartFreeDev: boolean; } export interface PlanInfoDto { commodityCode: string; commodityName: string; env: number; instanceId: string; isSubscribe: 0 | 1; orderNo: number; planStatus: PlanStatus; serviceBeginTime: number; serviceEndTime: number; stockId: string; isCanceled: 0 | 1; isAdditional: 0 | 1; } export interface DeviceInfo extends DeviceBaseInfo { productId: string; planList?: PlanInfoDto[]; isUseFreeService: 0 | 1; isUseCommonUserTrail: 0 | 1; isUseCommonDeviceTrail: 0 | 1; isTried?: 0 | 1; hasServiceOrder?: boolean; } export interface DeviceDetails extends DeviceInfo { haveAvailableService: 0 | 1; activeStockIdList: string[]; } export type QueryCameraListDto = { homeId: string; stockId?: string; pids?: string; /** 0 设备级,1 账号级 */ ownerType?: 1 | 0; serviceCode?: string; commodityCode?: string; categoryCode: string; }; export type BindDeviceInfo = DeviceInfo & { isBindCurrentService: boolean; }; export type ResBindDeviceDto = { totalDevices: number; bindDeviceNum: number; list: BindDeviceInfo[]; }; export type QueryBindDeviceDto = { homeId: string; stockId: string; bindUuidList?: string[]; unBindUuidList?: string[]; }; export type ServiceBusinessType = 'aiSmartFreeEvent' | 'aiSmartFreeEventImage2Text'; export type CustomEventCheckParams = { eventValue: string; devId: string; serviceBusinessType: ServiceBusinessType; }; export type CustomEventCheckResult = { available: boolean; recommend?: string[]; }; export type GetSmartEventSwitchStateParams = { devId: string; serviceBusinessType: ServiceBusinessType; }; export type GetSmartEventSwitchStateResult = { hadService: boolean; switchState: 0 | 1; extContent: string; }; export type UpdateSwitchStateParams = { devId: string; switchState: 0 | 1; serviceBusinessType: ServiceBusinessType; extContent: string; }; export type GetDeviceConfigParams = { devId: string; serviceBusinessType: ServiceBusinessType; }; export declare const enum DeviceServiceConfigState { Delete = 0, Available = 1, Unavailable = 2 } export interface DeviceServiceConfigItemDto { configId: number; configCode: string; configType: VisionEventType; configValue: string; configCodeIcon?: string; configState: DeviceServiceConfigState; } export type GetDeviceConfigResult = { hadService: boolean; switchState: 0 | 1; configItemList: DeviceServiceConfigItemDto[]; }; export type UpdateDeviceConfigParams = { devId: string; configId?: DeviceServiceConfigItemDto['configId']; configCode: DeviceServiceConfigItemDto['configCode']; configValue?: DeviceServiceConfigItemDto['configValue']; configType: DeviceServiceConfigItemDto['configType']; enableState: DeviceServiceConfigItemDto['configState']; serviceBusinessType: ServiceBusinessType; }; export type QueryServiceDetailDto = { homeId: string; stockId: string; }; export declare const enum StockStatus { NO_ENABLE = 1,// 未启用 ENABLED = 2 } export interface BaseServiceInfo { /** * 封面 */ cover: string; /** * 套餐名 */ commodityName: string; /** * 购买库存 ID */ stockId: string; /** * 套餐编码 */ commodityCode: string; /** * 服务周期 */ duration: number; /** * 服务周期的字符串表示 */ durationDesc: string; /** * 服务开始时间 */ serviceBeginTime?: number; /** * 服务到期时间 */ serviceEndTime?: number; /** * 是否为订阅商品 */ isSubscribe: 0 | 1; /** * 是否未来支付 */ isFuturePayments: 0 | 1; /** * 是否已退订 * 0 未退订; 1 已退订 */ isCanceled?: 0 | 1; /** * 启用状态 * 1 未启用 2 启用中 */ stockStatus: StockStatus; /** * 是否随机服务 */ isAdditional?: 1 | 0; } export interface ServiceDetailDto extends BaseServiceInfo { /** * 订阅 ID */ subscribeId?: string; /** * 未来支付计划 ID */ planId?: string; /** * 云存储已绑定设备列表 */ instanceList?: DeviceInfo[]; /** * 是否支持退订 * 0 不支持; 1 支持 */ supportCancel?: 0 | 1; /** * 服务对应的商品的上架状态 */ isPublish: 0 | 1; /** * 根机服务绑定的 uuid */ additionalUuid: string; /** * 是否允许智能魔方能力的服务 */ hasAigcProtectService?: boolean; /** * 服务大类 */ categoryCode: string; cloudService?: { /** * 绑定设备数量 */ bindDeviceNum: number; /** * 总数量 */ totalDevices: number; }; } export interface IAlbumVideoDateCountReq { stockId: number; gid: string; timeAlbumId: number; type?: string; } interface IFileUrl { fileUrl: string; fileName?: string; } export interface IAlbumVideoDateCountRes { type: string; description: string; startTime: number; endTime: number; coverInfo: IFileUrl; } export interface IAlbumVideoFileListRes { total: number; list: IAlbumVideoFileList[]; } export interface IAlbumVideoFileList { id: number; captureTime?: number; type?: 0 | 1 | 2; coverInfo?: IFileUrl; mediaInfo?: IFileUrl; } export interface IAlbumVideoFileListReq { stockId: number; gid: string; timeAlbumId: number; beginTime?: number; endTime?: number; pageNum?: number; pageSize?: number; queryIdFlag?: boolean; } export interface IAlbumFileDeleteReq { stockId: number; gid: string; timeAlbumId: number; albumRecordIds: string; } export interface IAlbumFileDeleteRes { result: boolean; } export interface TimeAlbumSettingDto { id: string; albumName: string; enableStatus: 0 | 1; timedCaptureConfig: string[]; smartCaptureConfig: VisionBoxEvent[]; } export type AlbumSettingSaveReq = { stockId: string; gid: string; } & Omit; export type AlbumSettingEditReq = { albumId: TimeAlbumSettingDto['id']; stockId: string; gid: string; } & Omit; export type GetAlbumSettingReq = { stockId: string; gid: string; }; export type QueryGetAiVisualList = { gid: string; }; export interface VisionBoxDto { visionBoxId: string; visionBoxName: string; gmtCreate: string; serviceStockId: string; serviceName: string; enableState: number; expiredTime: number; scenesType: SceneType; } export declare const enum BusinessType { aigcProtect = "aigcProtect", aiTimePhotoAlbumDetect = "aiTimePhotoAlbumDetect", aiSmartFreeEvent = "aiSmartFreeEvent" } export type GetAiVisualPresetEventParams = { gid: string; businessType: BusinessType; }; export interface PresetEvent { configCode: string; configCodeIcon: string; configCodeDesc: string; } export type CustomVisionEventCheckParams = { eventValue: string; gid: string; stockId: string; }; export type CustomVisionEventCheckRet = { available: boolean; recommend?: string[]; }; export interface IAlbumVideoFileDetailReq { stockId: number; gid: string; timeAlbumId: number; timeAlbumRecordId: number; } export type IAlbumVideoFileDetailRes = IAlbumVideoFileList; export type Audio = { fileNo: string; fileName: string; publicUrl?: string; }; export type FileInfo = { objectKey: string; fileName: string; fileSize: number; }; export type FileSign = { action: string; token: string; }; export type UploadState = { bizUrl?: string; pollingToken?: string; }; export type GetIpcRtcConfig = { devId: string; }; export type GetIpcRtcConfigRet = { maxZoomInTimes: number; [key: string]: any; }; export type GetIpcPointList = { devId: string; }; type PointItem = { devId: string; encryption: { key: string; }; id: string; mpId: string; name: string; pic: string; pos?: string; version?: number; }; export type GetIpcPointListRet = PointItem[]; export type UpdateIpcPointInfo = { devId: string; id: string; name: string; }; export type UpdateIpcPointInfoRet = boolean; export type GetVasUrlInfo = { path: string; isSupportMini: boolean; homeId: string; param: Record; categoryCode: string; deviceId: string; serveType: string; utmRtid?: string; }; export type GetVasUrlInfoRet = { type: number; url: string; }; export type GetVasServiceConfigList = { type: number; instanceId: string; homeId: string; }; type ServiceConfigItem = { categoryCode: string; configType: number; [key: string]: any; }; export type GetVasServiceConfigListRet = ServiceConfigItem[]; export type GetMovePathList = { devId: string; }; interface Point { id: number; mpId: number; coords: string; pic: string; encryption: { key: string; }; } interface Path { pathId: number; name: string; pointList: Point[]; } export type GetMovePathListRet = { devId: string; pathList: Path[]; }; export type GetMovePointDetails = { devId: string; mpId: number; }; export type GetMovePointDetailsRet = Point; type PetType = 'cat' | 'dog'; export type PetAdd = { petType: PetType; breedCode: string; sex: number; activeness: number; name: string; weight: number; birth: number; ownerId?: string; avatar?: string; timeZone: string; tuyaAppId: string; foodId?: number; rfid?: string; devIds?: string[]; idPhotos?: IdPhotos[]; features?: Feature[]; dataType: 'ai_pet_center' | string; }; type IdPhotos = Pick & { display: string; }; type Feature = { category: string; details: string[]; }; type Images = { imageDisplayUrl: string; objectKey: string; angle: string; desc: string; }; export type IFetchPetEatingRecordParams = { ownerId: string; uuid: string; petId?: number; startTime?: number; endTime?: number; pageNo: number; pageSize: number; }; export type IEatingRecord = { recordNo: string; devId: string; deviceName: string; ownerId: string; roomId: string; roomName: string; recordTime: number; isEncrypted: number; videoCoverDisplay: string; videoDisplay: string; videoDuration: number; petAction: string; pets: { petId: number; petName: string; }[]; }; export type GetVasServiceStatus = { categoryCode: string; }; export type GetVasServiceStatusRet = { haveService: boolean; }; export {};