import { IGetDpsInfos, IUpdateDpName, IUpdateGroupDpName, IGetWeatherQuality, IGetWeathers, ISaveCustomizePosition, IGetCustomizePosition, IGetDpsInfosResponse, IGetGroupDpsInfosResponse, IGetWeatherQualityResponse, IGetCustomizePositionResponse, IGetWeathersResponse, IGetDevProperty, IGetDevPropertyResponse, ISaveDevProperty, ISaveDevPropertyResponse } from './interface'; /** * 获取设备所有 DP 信息,通常用于获取设备 DP 名称,配合 updateDpName 使用 * * @public * @since @ray-js/ray 1.5.2 * @param params - 请求参数 * @returns DP 信息数组,每个元素包含 code、dpId、value、time、type、name * @example 基础用法 * ```ts * import { getDpsInfos } from '@ray-js/ray'; * * getDpsInfos({ * devId: 'vdevo169477319679442', * gwId: 'vdevo169477319679442', * }).then((res) => { * console.log('DP 信息:', res); * }).catch((error) => { * console.error(error); * }); * ``` */ declare const getDpsInfos: (params: IGetDpsInfos) => Promise; /** * 更新设备 DP 名称 * * @public * @since @ray-js/ray 1.5.2 * @param params - 请求参数 * @returns 是否成功更新 * @example 基础用法 * ```ts * import { updateDpName } from '@ray-js/ray'; * * updateDpName({ * devId: 'vdevo169477319679442', * dpId: '21', * name: 'work_mode', * }).then((res) => { * console.log('更新结果:', res); * }).catch((error) => { * console.error(error); * }); * ``` */ declare const updateDpName: (params: IUpdateDpName) => Promise; /** * 获取群组设备所有 DP 信息,通常用于获取群组设备 DP 名称,配合 updateGroupDpName 使用 * * @public * @since @ray-js/ray 1.5.2 * @param groupId - 群组 ID * @returns DP 信息对象,包含 code、dpId、value、name、time、type * @example 基础用法 * ```ts * import { getGroupDpsInfos } from '@ray-js/ray'; * * getGroupDpsInfos('1').then((response) => { * console.log('群组 DP 信息:', response); * }).catch((err) => { * console.error(err); * }); * ``` */ declare const getGroupDpsInfos: (groupId: string) => Promise; /** * 更新群组设备 DP 名称 * * @public * @since @ray-js/ray 1.5.2 * @param params - 请求参数 * @returns 是否成功更新群组设备 DP 名称 * @example 基础用法 * ```ts * import { updateGroupDpName } from '@ray-js/ray'; * * updateGroupDpName({ * group: '1', * dpId: '20', * name: 'switch_led', * }).then((response) => { * console.log('更新结果:', response); * }).catch((err) => { * console.error(err); * }); * ``` */ declare const updateGroupDpName: (params: IUpdateGroupDpName) => Promise; /** * 通过设备 ID 获取当天天气及空气质量 * * @public * @since @ray-js/ray 1.5.2 * @param params - 请求参数 * @param params.devId - 设备 ID * @param params.isLocal - 是否查询本地天气 * @returns 天气及空气质量信息,包含城市信息、温度、湿度、风向、风速、空气质量指数等 * @example 基础用法 * ```ts * import { getWeatherQuality } from '@ray-js/ray'; * * getWeatherQuality({ * devId: 'vdevo169477319679442', * isLocal: true, * }).then((res) => { * console.log('天气信息:', res); * }).catch((error) => { * console.error(error); * }); * ``` */ declare const getWeatherQuality: (params: IGetWeatherQuality) => Promise; /** * 获取天气预报信息 * * @public * @since @ray-js/ray 1.5.2 * @param params - 请求参数 * @param params.devId - 设备 ID * @param params.dataRange - 预报天数(默认值为 7,最大可预报天数为 7) * @returns 天气预报信息,包含城市信息及未来多日的天气数据(温度、湿度、风向、风速、日出日落时间等) * @example 基础用法 * ```ts * import { getWeathers } from '@ray-js/ray'; * * getWeathers({ * devId: 'vdevo169477319679442', * dataRange: 7, * }).then((res) => { * console.log('天气预报:', res); * }).catch((error) => { * console.error(error); * }); * ``` */ declare const getWeathers: (params: IGetWeathers) => Promise; /** * 创建设备自定义位置信息。当天气接口不适用于设备配网经纬度时,可通过自定义设备经纬度获取实时天气,例如户外穿戴设备。 * * @public * @since @ray-js/ray 1.5.2 * @param params - 请求参数 * @returns 是否成功保存 * @example 基础用法 * ```ts * import { saveCustomizePosition } from '@ray-js/ray'; * * saveCustomizePosition({ * devId: 'your_device_id', * lon: '113.2333', * lat: '23.1666', * }).then((response) => { * console.log('保存结果:', response); * }).catch((err) => { * console.error(err); * }); * ``` */ declare const saveCustomizePosition: (params: ISaveCustomizePosition) => Promise; /** * 设备自定义位置信息获取 * * @public * @since @ray-js/ray 1.5.2 * @param params - 请求参数 * @returns 包含 lon(经度)和 lat(纬度)的位置信息对象 * @example 基础用法 * ```ts * import { getCustomizePosition } from '@ray-js/ray'; * * getCustomizePosition({ * devId: 'your_device_id', * }).then((response) => { * console.log('位置信息:', response); * }).catch((err) => { * console.error(err); * }); * ``` */ declare const getCustomizePosition: (params: IGetCustomizePosition) => Promise; /** * 获取自定义设置的设备属性数据,可通过 saveDevProperty 写入 * * @public * @since @ray-js/ray 1.5.2 * @param params - 请求参数 * @returns 设备属性数据数组 * @example 基础用法 * ```ts * import { getDevProperty } from '@ray-js/ray'; * * getDevProperty({ * devId: 'your_device_id', * bizType: 0, * code: 'hello', * }).then((response) => { * console.log('设备属性:', response); * }).catch((err) => { * console.error(err); * }); * ``` */ declare const getDevProperty: (params: IGetDevProperty) => Promise; /** * 写入自定义设置的设备属性数据,保存后可通过 getDevProperty 获取 * * @public * @since @ray-js/ray 1.5.2 * @param params - 请求参数 * @returns 是否成功保存 * @example 基础用法 * ```ts * import { saveDevProperty } from '@ray-js/ray'; * * saveDevProperty({ * devId: 'your_device_id', * bizType: 0, * propertyList: JSON.stringify([ * { code: 'hello', value: 'world' }, * { code: 'foo', value: 'bar' }, * ]), * }).then((response) => { * console.log('保存结果:', response); * }).catch((err) => { * console.error(err); * }); * ``` */ declare const saveDevProperty: (params: ISaveDevProperty) => Promise; export interface GetRemoteLocalRelationParams { /** * 遥控器设备id */ devId: string; /** * 设备类型 * @default 0 // 缺省为0表示Zigbee */ type: number; } export interface GetRemoteLocalRelationResponse { locals: Array<{ categoryCode: string; code: string; localId: string; }>; } /** * 面板获取配网后分配的localIds * @param params { devId: string, type: number } * @returns */ declare const getRemoteLocalRelation: (params: GetRemoteLocalRelationParams) => Promise; declare enum BizType { Device = 0, Group = 1 } type GetLightHighPowerParams = { bizId: string; bizType: BizType; abilityCodes: string; }; type GetLightHighPowerResponse = { abilityCode: string; buyableForCustomer?: boolean; vasEnabled: boolean; }[] | []; /** * 判断当前设备是否支持高级能力 @ray-js/ray^1.5.7 新增 * @param params { devId: string, type: number } * @returns */ declare const getLightHighPower: (params: GetLightHighPowerParams) => Promise; /** * 设置设备地址 * @param devId 设备id * @param address 设备地址 */ declare const setDeviceAddress: (devId: string, address: string) => void; /** * 获取设备地址 * @param devId 设备id */ declare const getDeviceAddress: (devId: string, propertyKey: string) => void; export { getDpsInfos, updateDpName, getGroupDpsInfos, updateGroupDpName, getWeatherQuality, getWeathers, saveCustomizePosition, getCustomizePosition, getDevProperty, saveDevProperty, getRemoteLocalRelation, getLightHighPower, setDeviceAddress, getDeviceAddress, };