Skip to content
简体中文
Tuya MiniApp
开发
Ray 开发
API
门锁
蓝牙pro门锁
设置

获取语音文件列表

getVoiceFileList

引入

使用该功能需要 @ray-js/ray 版本 1.6.6 及以上。

import { getVoiceFileList } from '@ray-js/ray';

参数

GetVoiceFileListParams

属性类型必填说明
devIdstring设备ID

返回

GetVoiceFileListResponse

Array<FileItem>,包含语音文件列表项。

FileItem

属性类型说明
fileTypenumber语言类型(0=简体中文、1=英文、2=日文、3=德文、4=西班牙语、5=拉丁语、6=法语、7=俄语、8=意大利语、9=繁体中文、10=韩语)
describestring描述
fileKeystring文件 key
versionstring版本
fileStatusnumber文件状态(0:无 1:使用中)

函数定义示例

/**
 * 获取语音文件列表
 */
export function getVoiceFileList(params: GetVoiceFileListParams): Promise<GetVoiceFileListResponse>;

获取语音文件下载地址

getDownloadUrl

引入

使用该功能需要 @ray-js/ray 版本 1.6.6 及以上。

import { getDownloadUrl } from '@ray-js/ray';

参数

GetDownloadUrlParams

属性类型必填说明
devIdstring设备ID
fileKeystring文件key

返回

GetDownloadUrlResponse

string,表示语音文件的下载地址。

函数定义示例

/**
 * 获取语音文件下载地址
 */
export function getDownloadUrl(params: GetDownloadUrlParams): Promise<GetDownloadUrlResponse>;

获取当前用户在设备下的地理围栏场景信息

getBleGeofenceList

引入

使用该功能需要 @ray-js/ray 版本 1.6.6 及以上。

import { getBleGeofenceList } from '@ray-js/ray';

参数

GetBleGeofenceListParams

属性类型必填说明
devIdstring设备ID

返回

GetBleGeofenceListResponse

表示当前用户在设备下的地理围栏场景信息。

属性类型说明
codestring编号
titlestring标题
descriptionstring描述
displayColorstring风格-颜色
iconstring图标URL
backgroundstring背景图URL
enableboolean是否启用
ruleVORuleVO规则详细信息

RuleVO

属性类型说明
idnumber地理围栏Id
namestringrule的名称
devIdstring设备ID
ownerIdnumber家庭Id
uidstring用户的uid
statusboolean当前数据是否有效
modulestring模块. APP用它来区分是公版还是OEM
geoTitlestring地理围栏的title
centerLngstring中心经度
centerLatstring中心纬度
radiusstring半径
activeTimenumber触发地理围栏之后,多久之内下发开门指令算有效.一般是秒当单位
rssi?stringRSSI信号值(可选)
displayColor?string风格-颜色(可选)
icon?string场景规则中的 图标(可选)
background?string场景规则中的 背景图(可选)
title?string场景规则中的 标题(可选)

函数定义示例

/**
 * 获取当前用户在设备下的地理围栏场景信息
 */
export function getBleGeofenceList(params: GetBleGeofenceListParams): Promise<GetBleGeofenceListResponse>;

注册地理围栏

registerBleCloudGeofence

引入

使用该功能需要 @ray-js/ray 版本 1.6.6 及以上。

import { registerBleCloudGeofence } from '@ray-js/ray';

参数

RegisterBleCloudGeofenceParams

属性类型必填说明
devIdstring设备ID
ownerIdnumber家庭ID
geoFenceInfoGeoFenceInfo地理围栏信息

GeoFenceInfo

属性类型必填说明
modulestring模块. APP用它来区分是公版还是OEM
geoTitle?string地理围栏的title
centerLngstring中心经度
centerLatstring中心纬度
radiusstring半径
activeTimenumber触发地理围栏之后,多久之内下发开门指令算有效.一般是秒当单位
rssi?stringRSSI信号值
displayColor?string风格-颜色
icon?string场景规则中的 图标
background?string场景规则中的 背景图
title?string场景规则中的 标题

返回

RegisterBleCloudGeofenceResponse

表示注册地理围栏的响应信息。

属性类型说明
idnumber地理围栏ID
devIdstring设备ID
ownerIdnumber家庭ID
uidstring用户ID
statusboolean当前数据是否有效
modulestring模块. APP用它来区分是公版还是OEM
geoTitle?string地理围栏的title
centerLngstring中心经度
centerLatstring中心纬度
radiusstring半径
activeTimenumber触发地理围栏之后,多久之内下发开门指令算有效.一般是秒当单位
rssi?stringRSSI信号值
displayColor?string风格-颜色
icon?string场景规则中的 图标
background?string场景规则中的 背景图
title?string场景规则中的 标题

函数定义示例

/**
 * 注册地理围栏
 */
export function registerBleCloudGeofence(params: RegisterBleCloudGeofenceParams): Promise<RegisterBleCloudGeofenceResponse>;

修改地理围栏

editBleCloudGeofence

引入

使用该功能需要 @ray-js/ray 版本 1.6.6 及以上。

import { editBleCloudGeofence } from '@ray-js/ray';

参数

EditBleCloudGeofenceParams

属性类型必填说明
idnumber地理围栏ID
geoFenceInfoGeoFenceInfo地理围栏信息

GeoFenceInfo

属性类型必填说明
modulestring模块. APP用它来区分是公版还是OEM
geoTitle?string地理围栏的title
centerLngstring中心经度
centerLatstring中心纬度
radiusstring半径
activeTimenumber触发地理围栏之后,多久之内下发开门指令算有效.一般是秒当单位
rssi?stringRSSI信号值
displayColor?string风格-颜色
icon?string场景规则中的 图标
background?string场景规则中的 背景图
title?string场景规则中的 标题

返回

EditBleCloudGeofenceResponse

boolean,表示操作是否成功。

函数定义示例

/**
 * 修改地理围栏
 */
export function editBleCloudGeofence(params: EditBleCloudGeofenceParams): Promise<EditBleCloudGeofenceResponse>;

开启/关闭 地理围栏

handleBleCloudGeofence

引入

使用该功能需要 @ray-js/ray 版本 1.6.6 及以上。

import { handleBleCloudGeofence } from '@ray-js/ray';

参数

HandleBleCloudGeofenceParams

属性类型必填说明
idnumber地理围栏ID
targetStatusboolean目标状态
  • id: 需要开启或关闭的地理围栏的唯一标识符。
  • targetStatus: 目标状态,true 表示开启,false 表示关闭。

返回

HandleBleCloudGeofenceResponse

boolean,表示操作是否成功。

函数定义示例

/**
 * 开启/关闭 地理围栏
 */
export function handleBleCloudGeofence(params: HandleBleCloudGeofenceParams): Promise<HandleBleCloudGeofenceResponse>;

获取蓝牙开门密钥(用于地理围栏处)

getRemoteOpenKey

引入

使用该功能需要 @ray-js/ray 版本 1.6.6 及以上。

import { getRemoteOpenKey } from '@ray-js/ray';

参数

GetRemoteOpenKeyParams

属性类型必填说明
devIdstring设备ID

返回

GetRemoteOpenKeyResponse

表示蓝牙开门密钥的信息。

属性类型说明
devUnlockIdstring门锁在家庭里的ID,在dp协议中是从机ID
dpIdnumber16进制的字符串。门锁初始化指令。
wakeUpInsstring16进制的字符串。门锁初始化指令。
distributedboolean是否下发指令
insstring16进制的字符串。随机数内容

函数定义示例

/**
 * 获取蓝牙开门密钥(用于地理围栏处)
 */
export function getRemoteOpenKey(params: GetRemoteOpenKeyParams): Promise<GetRemoteOpenKeyResponse>;
此页内容是否对您有帮助?
意见反馈
小程序机器人助手
需求提交
|
论坛反馈
|
问卷调查
|
官方群聊