npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@quec/rn-device-module

v3.2.2

Published

设备桥RN扩展组件

Readme

QuecRNDeviceModule

设备桥组件

类型|版本|适用平台|负责人 -|-|-|- module|3.2.0|all|[email protected]

3.2.0 Changelog:
none

方法

isWebSocketSubscribe

获取当前设备WS订阅通道状态,订阅状态为true,不代表设备在线,只代表app和云端对当前设备进行了订阅

起始版本|适用平台 -|- 1.8.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|promise|promisecb|回调 callback {"subscribe": true/false }

getDeviceConnectingState

获取设备通道连接中状态

起始版本|适用平台 -|- 1.8.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|promise|promisecb|回调 callback {"connectingState": 0/1/2/3/4/5/6/7}onlineStateMaskWS = 1 << 0,onlineStateMaskWifi = 1 << 1,onlineStateMaskBle = 1 << 2,(0: all offline, 1: websocket online, 2 : wifi online, 3: wifi + websocket online, 4: ble online, 5: websocket + ble online, 6: ble + wifi online , 7: wifi + ble + ws online)

writeDpsByHttp

writeDpsByHttp

起始版本|适用平台 -|- 1.8.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|dps|Array<object>|– dps 确保code和value不为空 [ {id:0, code:"electric" type:BOOL, value:false} ,{id:1, code:"electric2", type:INT, value:2}] 2|deviceList|Array<object>|– deviceList 设备列表 [{"deviceKey":"", "productKey":""}] 3|type|integer|- 类型 1:透传 2:属性 3:服务 4|extraData|object|– {dataFormat 数据类型 1:Hex 2:Text(当type为透传时,需要指定 dataFormat)cacheTime 缓存时间,单位为秒,缓存时间范围 1-7776000 秒,启用缓存时必须设置缓存时间isCache 是否启用缓存 1:启用 2:不启用,默认不启用isCover 是否覆盖之前发送的相同的命令 1:覆盖 2:不覆盖,默认不覆盖,启用缓存时此参数有效查看接口定义} 5|promise|promisecb|回调 callback

readDpsWithExtraData

read data points

起始版本|适用平台 -|- 1.6.8|all

序号|参数名|参数类型|描述 -|-|-|- 1|dps|Array<object>|– dps [ {id:0, type:BOOL, value:false} ,{id:1, type:INT, value:2}] 2|extraData|object|– mapcacheTime number 指令缓存时间,ws通道有效,单位是smsgId number 消息Id,ws通道有效 3|promise|promisecb|回调 callback

readDpsWithExtraDataAndMode

read data points

起始版本|适用平台 -|- 1.6.8|all

序号|参数名|参数类型|描述 -|-|-|- 1|dps|Array<object>|– dps [ {id:0, type:BOOL, value:false} ,{id:1, type:INT, value:2}] 2|extraData|object|– mapcacheTime number 指令缓存时间,ws通道有效,单位是smsgId number 消息Id,ws通道有效 3|mode|integer|– mode 下发模式: 0 auto,1: websocket 2:wifi 3:ble 4|promise|promisecb|回调 callback

writeDpsWithExtraData

write data points

起始版本|适用平台 -|- 1.6.8|all

序号|参数名|参数类型|描述 -|-|-|- 1|dps|Array<object>|– dps [ {id:0, type:BOOL, value:false} ,{id:1, type:INT, value:2}] 2|extraData|object|– mapcacheTime number 指令缓存时间,ws通道有效,单位是smsgId number 消息Id,ws通道有效 3|promise|promisecb|回调 callback

writeDpsWithExtraDataAndMode

write data points

起始版本|适用平台 -|- 1.6.8|all

序号|参数名|参数类型|描述 -|-|-|- 1|dps|Array<object>|– dps [ {id:0, type:BOOL, value:false} ,{id:1, type:INT, value:2}] 2|extraData|object|– mapcacheTime number 指令缓存时间,ws通道有效,单位是smsgId number 消息Id,ws通道有效 3|mode|integer|– mode 下发模式: 0 auto,1: websocket 2:wifi 3:ble 4|promise|promisecb|回调 callback

getBleState

获取设备通道状态

起始版本|适用平台 -|- 1.4.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|promise|promisecb|回调 callback {"state": 0/1/2}(0: 未开启, 1: 未授权, 2 : 可用)

getTslAndAttrs

获取物模型以及属性值

起始版本|适用平台 -|- 2.16.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|mapproductKey string 产品keydeviceKey string 设备keycodeList string 非必填 查询的属性标识符gatewayDk string 网关设备的 Device KeygatewayPk string 网关设备的 Product Key和查询类型配合使用,如果查询多个属性,使用英文逗号分隔type string 非必填 查询类型1 查询设备基础属性2 查询物模型属性3 查询定位信息查询类型可以单选和多选,如果需要查询多个类型的属性值,使用英文逗号分隔filterType 过滤类型0: 仅获取属性定义(默认行为)1: 获取属性和事件定义2: 获取属性,事件和服务定义 (为后续预留) 2|promise|promisecb|promise 执行回调

readDps

read data points

起始版本|适用平台 -|- 1.4.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|dps|Array<object>|– dps [ {id:0, type:BOOL, value:false} ,{id:1, type:INT, value:2}] 2|promise|promisecb|回调 callback

writeDps

write data points

起始版本|适用平台 -|- 1.4.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|dps|Array<object>|– dps [ {id:0, type:BOOL, value:false} ,{id:1, type:INT, value:2}] 2|promise|promisecb|回调 callback

writeTransparent

write transparent data

起始版本|适用平台 -|- 1.7.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|data|string|透传数据, 二进制base64转换的字符串 2|mode|integer|发送模式 3|extraData|object|额外参数(预留) 4|promise|promisecb|回调callback

readDpsWithMode

read data points

起始版本|适用平台 -|- 1.4.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|dps|Array<object>|– dps [ {id:0, type:BOOL, value:false} ,{id:1, type:INT, value:2}] 2|mode|integer|– mode 下发模式: 0 auto,1: websocket 2:wifi 3:ble 3|promise|promisecb|回调 callback

writeDpsWithMode

write data points

起始版本|适用平台 -|- 1.4.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|dps|Array<object>|– dps [ {id:0, type:BOOL, value:false} ,{id:1, type:INT, value:2}] 2|mode|integer|– mode 下发模式: 0 auto,1: websocket 2:wifi 3:ble 3|promise|promisecb|回调 callback

getOnlineState

获取设备通道状态

起始版本|适用平台 -|- 1.4.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|promise|promisecb|回调 callback {"onlineState": 0/1/2/3/4/5/6/7}onlineStateMaskWS = 1 << 0,onlineStateMaskWifi = 1 << 1,onlineStateMaskBle = 1 << 2,(0: all offline, 1: websocket online, 2 : wifi online, 3: wifi + websocket online, 4: ble online, 5: websocket + ble online, 6: ble + wifi online , 7: wifi + ble + ws online)

connectChannel

建立通道,(设备会自动根据设备通道能力capabilitiesBitmask建立通道,此API用于手动切换指定通道)

起始版本|适用平台 -|- 1.4.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|mode|integer|– mode 建立通道模式: 0 auto,1: websocket 2:wifi 3:ble注意:1,建立的通通与已连接通道不同时,已连接通道会断开。2,当设备不具备相应通道,建立其不具备的通道会失败。不会再自动建立其他通道

disconnectChannel

断开通道,(

起始版本|适用平台 -|- 1.4.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|type|integer|– type 通道类型,0: 关闭所有通道(关闭wifi和ble), 2:wifi 3:ble

isWebSocketLoginCallback 弃用

获取websocket是否登录成功

该方法已弃用并不再维护,如遇问题请联系开发者

起始版本|适用平台 -|- 1.0.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|isLoginCallback|successcb|Func 接受是否登录websocket回调 已登录成功 true 登录失败 false

subscribeDevicesWithList 弃用

订阅设备

该方法已弃用并不再维护,如遇问题请联系开发者

起始版本|适用平台 -|- 1.0.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|list|Array<object>|订阅设备列表,订阅结果QuecDeviceServiceWebSocketDelegate返回[{"deviceKey": "1234567890","messageType": ["ONLINE"],"productKey": "p12345"},{"deviceKey": "1234567890","messageType": ["ONLINE","STATUS"],"productKey": "p12345"}]

unSubscribeDevicesWithList 弃用

取消订阅设备

该方法已弃用并不再维护,如遇问题请联系开发者

起始版本|适用平台 -|- 1.0.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|list|Array<object>|取消订阅设备列表,取消订阅结果QuecDeviceServiceWebSocketDelegate返回[{"deviceKey": "1234567890","productKey": "p12345"},{"deviceKey": "1234567890","productKey": "p12345"}]

sendDataToDeviceByWebSocketWithDataDict 弃用

获取设备业务属性值

该方法已弃用并不再维护,如遇问题请联系开发者

起始版本|适用平台 -|- 1.0.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|发送数据,需要在delegate的websocketDidOpen回调之后才能调用透传{"cmd": "send","data": {"cacheTime": 3600,"dataFormat": "Text","deviceKey": "866123456789015","isCache": true,"productKey": "p12345","raw": "123456","type": "RAW"}}物模型{"cmd": "send","data": {"deviceKey": "1234567890","kv": "[{"id":5,"name":"openapi","type":"BOOL","value":"true"}]","productKey": "p12345","type": "WRITE-ATTR"}}

getDeviceListWithPageNumber 弃用

获取设备列表

该方法已弃用并不再维护,如遇问题请联系开发者

起始版本|适用平台 -|- 1.0.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|pageNumber|integer|number 页码 2|pageSize|integer|number 页大小 3|promise|promisecb|promise 执行回调callback {"data": {"list" : [], "total" : 12}}

getProductTSLWithProductKey 弃用

获取设备业务物模型属性值

该方法已弃用并不再维护,如遇问题请联系开发者

起始版本|适用平台 -|- 1.0.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|mapproductKey string 产品keydeviceKey string 设备keycodeList string 非必填 查询的属性标识符gatewayDk string 网关设备的 Device KeygatewayPk string 网关设备的 Product Key和查询类型配合使用,如果查询多个属性,使用英文逗号分隔type string 非必填 查询类型1 查询设备基础属性2 查询物模型属性3 查询定位信息查询类型可以单选和多选,如果需要查询多个类型的属性值,使用英文逗号分隔 2|promise|promisecb|promise 执行回调

getDeviceBusinessAttributesWithProductKey 弃用

获取设备业务属性值

该方法已弃用并不再维护,如遇问题请联系开发者

起始版本|适用平台 -|- 1.0.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|mapproductKey string 产品keydeviceKey string 设备keycodeList string 非必填 查询的属性标识符和查询类型配合使用,如果查询多个属性,使用英文逗号分隔type string 非必填 查询类型1 查询设备基础属性2 查询物模型属性3 查询定位信息查询类型可以单选和多选,如果需要查询多个类型的属性值,使用英文逗号分隔 2|promise|promisecb|promise 执行回调

updateDeviceNameByShareUserWithDeviceName 弃用

更改分享设备名称

该方法已弃用并不再维护,如遇问题请联系开发者

起始版本|适用平台 -|- 1.0.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|deviceName|string|string 设备名称 2|shareCode|string|string 分享码 3|promise|promisecb|promise 执行回调

updateDeviceName 弃用

更改分享设备名称

该方法已弃用并不再维护,如遇问题请联系开发者

起始版本|适用平台 -|- 1.0.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|deviceName|string|string deviceName 2|productKey|string|string product key 3|deviceKey|string|string deviceKey 4|promise|promisecb|promise 执行回调

getGatewayDeviceChildListWithParams 弃用

查询网关设备下子设备列表

该方法已弃用并不再维护,如遇问题请联系开发者

起始版本|适用平台 -|- 1.0.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|deviceKey string 必传 网关设备deviceKeyproductKey string 必传 网关设备productKeypageNumber number 必传 页码pageSize number 必传 页大小 2|promise|promisecb|promise 执行回调callback {"data": {"list" : [], "total" : 12}}

unbindDeviceWithDeviceKey 弃用

设备解绑

该方法已弃用并不再维护,如遇问题请联系开发者

起始版本|适用平台 -|- 1.0.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|deviceKey|string|string device key 2|productKey|string|string product key 3|promise|promisecb|promise 执行回调

unShareDeviceByShareUserWithShareCode 弃用

设备解绑

该方法已弃用并不再维护,如遇问题请联系开发者

起始版本|适用平台 -|- 1.0.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|shareCode|string|string 分享码 2|promise|promisecb|promise 执行回调

getPropertyChartListWithParams

获取设备属性图表列表

起始版本|适用平台 -|- 1.1.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|productKey 产品keydeviceKey 设备keystartTimestamp 开始时间(毫秒时间戳)endTimestamp 结束时间(毫秒时间戳)attributeCode 物模型属性标识符,查询多个属性时使用英文逗号分隔gatewayDk 网关设备的 Device KeygatewayPk 网关设备的 Product KeycountType 聚合类型(默认3):1-最大值 2-最小值 3-平均值 4-差值 5-总值timeGranularity 统计时间粒度(默认2):1-月 2-日 3-小时 4-分钟 5-秒callback {"data": []} 2|promise|promisecb|promise 执行回调

getDeviceShareUserListWithDeviceKey

获取设备分享人列表

起始版本|适用平台 -|- 1.1.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|deviceKey|string|string 设备名称 2|productKey|string|string 产品key 3|promise|promisecb|promise 执行回调

setShareInfoByOwnerWithDeviceKey

分享人设置分享信息

起始版本|适用平台 -|- 1.1.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|deviceKey string 设备keyproductKey string 产品keyacceptingExpireTime number 分享二维码种子失效时间 时间戳(毫秒),表示该分享在此时间戳时间内没有使用,会失效coverMark number 覆盖标志:1 直接覆盖上条有效分享(默认)(覆盖原有的分享码);2 直接添加,允许多条并存;3 只有分享时间延长了,才允许覆盖上条分享isSharingAlwaysValid bool 设备是否永久有效sharingExpireTime number 设备使用到期时间 时间戳(毫秒),表示该分享的设备,被分享人可以使用的时间,isSharingAlwaysValid为YES时该参数无效 2|promise|promisecb|promise 执行回调

unShareDeviceByOwnerWithShareCode

分享人取消分享

起始版本|适用平台 -|- 1.1.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|shareCode|string|string 分享码 2|promise|promisecb|promise 执行回调

getLocationHistoryWithParams

获取设备历史轨迹

起始版本|适用平台 -|- 1.1.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|productKey 产品keydeviceKey 设备keystartTimestamp 开始时间(毫秒时间戳)endTimestamp 结束时间(毫秒时间戳)gatewayDk 网关设备的 Device KeygatewayPk 网关设备的 Product KeylocateTypes 定位类型(默认查询所有类型的定位),查询多种定位时使用英文逗号分隔GNSS-全球导航卫星系统GPS-美国导航定位系统GL-俄罗斯格洛纳导航定位系统GA-欧盟伽利略卫星导航系统BD/PQ-中国导航定位系统LBS-基于通信运营商的基站定位系统 2|promise|promisecb|

getDeviceInfoByDeviceKey

获取设备信息

起始版本|适用平台 -|- 1.2.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|deviceKey|string|string 设备key 2|productKey|string|string 产品key 3|promise|promisecb|promise 执行回调

getPropertyDataListWithParams

获取设备属性信息

起始版本|适用平台 -|- 1.2.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|mapproductKey 产品keydeviceKey 设备keystartTimestamp 开始时间(毫秒时间戳)endTimestamp 结束时间(毫秒时间戳)attributeCode 物模型属性标识符,查询多个属性时使用英文逗号分隔gatewayDk 网关设备的 Device KeygatewayPk 网关设备的 Product KeypageNumber 当前页,默认为第 1 页pageSize 页大小,默认为 10 条 2|promise|promisecb|promise 执行回调

getPropertyStatisticsWithParams

获取设备属性环比统计数据

起始版本|适用平台 -|- 1.2.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|mapproductKey 产品keydeviceKey 设备keycurrentTimestamp 当前时间(毫秒时间戳attributeCode 物模型属性标识符,查询多个属性时使用英文逗号分隔gatewayDk 网关设备的 Device KeygatewayPk 网关设备的 Product KeycountType 聚合类型(默认3):1-最大值 2-最小值 3-平均值 4-差值 5-总值timeGranularities 统计时间粒度,查询多个粒度时使用英文逗号分隔(默认1):1-日 2-周 3-月 4-年callback {"data": []} 2|promise|promisecb|promise 执行回调

getDeviceInfoByShareCode

通过分享码查询设备信息

起始版本|适用平台 -|- 1.3.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|shareCode|string|分享码 2|promise|promisecb|回调

getDeviceListByDeviceName

获取设备列表-根据设备名称搜索

起始版本|适用平台 -|- 1.3.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|deviceName|string|设备名称 2|pageNumber|integer|number 页码 3|pageSize|integer|number 页大小 4|promise|promisecb|回调 callback {"data": {"list" : [], "total" : 12}}

bindDeviceBySerialNumber

通过SN绑定设备

起始版本|适用平台 -|- 1.3.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|serialNumber|string|string 设备SN码 2|productKey|string|string 产品key 3|deviceName|string|string 设备名称 4|promise|promisecb|回调 callback

bindDeviceByAuthCode

通过authCode绑定设备 可用于wifi/wifi+蓝牙设备绑定

起始版本|适用平台 -|- 1.3.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|Map 包含以下属性authCode string 设备authCodeproductKey string 产品keydeviceKey string 设备keydeviceName string 设备名称 2|promise|promisecb|回调 callback

bindDeviceByPSWAuthCode

通过authCode + password绑定设备 可用于蓝牙设备绑定

起始版本|适用平台 -|- 1.3.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|Map 包含以下属性authCode string 设备authCodeproductKey string 产品keydeviceKey string 设备keypassword string 设备passworddeviceName string 设备名称 2|promise|promisecb|回调 callback

getFetchPlanWithProductKey

查询设备升级信息

起始版本|适用平台 -|- 1.3.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|productKey|string|string 产品key 2|deviceKey|string|string 设备key 3|params|object|map 其他信息 非必传batteryLevelLimit number 设备剩余电量百分比mcuVersions array 固件信息 componentNo string 升级组件标识 version string 升级组件版本minSignalIntensity number 设备最小信号量 dbMmoduleVersion string 模组版本upgradeTime number 升级时间时间戳,默认为当前时间戳useSpace number 所需磁盘空间,KB{'batteryLevelLimit':1, 'mcuVersions':[{'componentNo': '', 'version': ''}], 'minSignalIntensity':1, 'moduleVersion':'', 'upgradeTime':1, 'useSpace':1} 4|promise|promisecb|回调 callback

reportDeviceUpgradeStatusWithProductKey

上报设备升级信息

起始版本|适用平台 -|- 1.3.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|mapproductKey string 产品keydeviceKey string 设备keycomponentNo string 升级固件标识reportStatus number 升级状态 0 - 1 2 2|promise|promisecb|回调 callback

sendDataToDevicesByHttpWithData

设备批量控制

起始版本|适用平台 -|- 1.3.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|Mapdata 遵循tsl格式的json string [{"id":62,"value":99,"type":"INT","name":"温度(temp)"},{"id":63,"value":"true","type":"BOOL","name":"开关机状态(powerstate)"}]deviceList 设备列表 [{"deviceKey":"", "productKey":""}]type number 类型 1:透传 2:属性 3:服务dataFormat number 数据类型 1:Hex 2:Text(当type为透传时,需要指定 dataFormat)cacheTime number 非必传 缓存时间,单位为秒,缓存时间范围 1-7776000 秒,启用缓存时必须设置缓存时间isCache number 非必传 是否启用缓存 1:启用 2:不启用,默认不启用isCover number 非必传 是否覆盖之前发送的相同的命令 1:覆盖 2:不覆盖,默认不覆盖,启用缓存时此参数有效 2|promise|promisecb|回调 callback

addCornJob

创建定时任务

起始版本|适用平台 -|- 1.3.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|productKey – string 必传 产品keydeviceKey – string 必传 设备keytype – string 必传 定时任务类型,once: 执行一次,day-repeat: 每天重复,custom-repeat: 自定义重复,multi-section: 多段执行,random: 随机执行,delay: 延迟执行(倒计时)timers:[{action – string 必传 定时任务执行的命令,格式:物模型的 json 字符串,time – string 非必传 执行时间,格式为 HH:mm:ss, 当 type = once || day-repeat || custom-repeat ||multi-section 时必填,startTime – string 非必传 当 type 为 random 时必填,格式为 "HH:mm:ss",如 "12:00:00"endTime – string 非必传 当 type 为 random 时必填,格式为 "HH:mm:ss",如 "12:00:00"delay – number 非必传 延迟执行时间,单位为秒, 当 type = delay 时必填,单位为 s}]enabled – 定时任务状态:false-停止(默认) true-启动dayOfWeek – string 非必传 周几执行:1-周一 2-周二 3-周三 4-周四 5-周五 6-周六 7-周日, 可以多选,传多个值时使用英文逗号分隔, 当 type = custom-repeat || multi-section || random 时必填 2|promise|promisecb|回调 callback {"data": {}}

setCronJob

修改定时任务

起始版本|适用平台 -|- 1.3.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|productKey – string 必传 产品keydeviceKey – string 必传 设备keyruleId – string 必传 规则唯一标识,修改规则实例信息时必填type – string 必传 定时任务类型,once: 执行一次,day-repeat: 每天重复,custom-repeat: 自定义重复,multi-section: 多段执行,random: 随机执行,delay: 延迟执行(倒计时)timers:[{action – string 必传 定时任务执行的命令,格式:物模型的 json 字符串,time – string 非必传 执行时间,格式为 HH:mm:ss, 当 type = once || day-repeat || custom-repeat ||multi-section 时必填,startTime – string 非必传 当 type 为 random 时必填,格式为 "HH:mm:ss",如 "12:00:00"endTime – string 非必传 当 type 为 random 时必填,格式为 "HH:mm:ss",如 "12:00:00"delay – number 非必传 延迟执行时间,单位为秒, 当 type = delay 时必填,单位为 s}]enabled – 定时任务状态:false-停止(默认) true-启动dayOfWeek – string 非必传 周几执行:1-周一 2-周二 3-周三 4-周四 5-周五 6-周六 7-周日, 可以多选,传多个值时使用英文逗号分隔, 当 type = custom-repeat || multi-section || random 时必填 2|promise|promisecb|回调 callback {"data": {}}

getCronJobList

查询设备下定时任务列表

起始版本|适用平台 -|- 1.3.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|productKey – string 必传 产品keydeviceKey – string 必传 设备keytype – string 必传 定时任务类型,once: 执行一次,day-repeat: 每天重复,custom-repeat: 自定义重复,multi-section: 多段执行,random: 随机执行,delay: 延迟执行(倒计时)page – number 分页页码,默认: 1pageSize – number 分页大小,默认: 10 2|promise|promisecb|回调 callback {"data": {"list" : [], "total" : 12}}

getCronJobInfo

查询定时任务详情

起始版本|适用平台 -|- 1.3.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|ruleId|string|– string 必传 定时任务ID 2|promise|promisecb|回调 callback {"data": {}}

batchDeleteCronJob

批量删除定时任务

起始版本|适用平台 -|- 1.3.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|– {ruleIdList:[] String[] 必传 定时任务ID} 2|promise|promisecb|回调 callback {"data": {}}

getProductCornJobLimit

查询产品下定时任务限制数

起始版本|适用平台 -|- 1.3.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|productKey|string|– string 必传 产品key 2|promise|promisecb|回调callback {"data": {}}

openWebSocket

打开websocket

起始版本|适用平台 -|- 1.3.0|all

closeWebSocket

关闭websocket

起始版本|适用平台 -|- 1.3.0|all

getProductTSLWithCacheByProductKey

查询产品的tls模型

起始版本|适用平台 -|- 1.5.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|param|object|-{productKey:String } --必传 2|promise|promisecb|-{callback:{data:{}}

listDeviceEvent

门锁事件日志

起始版本|适用平台 -|- 1.9.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|params|object|{codeList:["",""],productKey:"",deviceKey:"",startTime:long,endTime:long,pageNumber:1,pageSize:10} 2|promise|promisecb|

unShareDeviceByShareUserWithShareCodeIpc 弃用

设备解绑

该方法已弃用并不再维护,如遇问题请联系开发者

起始版本|适用平台 -|- 1.9.6|all

序号|参数名|参数类型|描述 -|-|-|- 1|pk|string|string 产品id 2|dk|string|string 设备id 3|shareCode|string|string 分享码 4|promise|promisecb|promise 执行回调

subscribeDevice

订阅设备(非当前面板设备)

起始版本|适用平台 -|- 2.0.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|pk|string|string 产品id 2|dk|string|string 设备id

unSubscribeDevice

取消订阅 (非当前面板设备)

起始版本|适用平台 -|- 2.0.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|pk|string|string 产品id 2|dk|string|string 设备id

deviceAssociationWithList

设置主从设备关联关系

起始版本|适用平台 -|- 2.0.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|list|Array<object>|- array 关联设备列表[{"deviceKey": "1234567890","productKey": "p12345",...设备其他信息},{"deviceKey": "1234567890","productKey": "p12345"...设备其他信息}] 2|master|object|- DeviceModel Object 主设备信息 3|fid|string|- string 家庭 id, 没有传空 4|promise|promisecb|promise 执行回调

deviceAssociation

设备关联关系查询

起始版本|适用平台 -|- 2.0.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|master|object|- DeviceModel Object 主设备信息 2|fid|string|- string 家庭 id, 没有传空 3|codelist|string|- string 物模型code, 用逗号分隔 4|promise|promisecb|promise 执行回调

deviceDisassociation

设备关联关系解除

起始版本|适用平台 -|- 2.0.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|device|object|- DeviceModel Object 从设备信息 2|fid|string|- string 家庭 id, 没有传空 3|promise|promisecb|promise 执行回调

deviceAssociationConfig

设备关联关系配置查询

起始版本|适用平台 -|- 2.0.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|pk|string|string 主设备pk 2|promise|promisecb|promise 执行回调

getDeviceOnlineState

通过设备dk,pk获取指定设备设备通道状态

起始版本|适用平台 -|- 2.0.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|pk|string|- string 设备 productkey 2|dk|string|- string 设备 devicekey 3|promise|promisecb|回调 callback {"onlineState": 0/1/2/3/4/5/6/7}onlineStateMaskWS = 1 << 0,onlineStateMaskWifi = 1 << 1,onlineStateMaskBle = 1 << 2,(0: all offline, 1: websocket online, 2 : wifi online, 3: wifi + websocket online, 4: ble online, 5: websocket + ble online, 6: ble + wifi online , 7: wifi + ble + ws online)

setOfflineReminder

设置离线提醒开关

起始版本|适用平台 -|- 2.4.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|enableOfflineReminder|integer|number 开关 0关闭1开启 2|productKey|string|- string productKey 3|deviceKey|string|- string deviceKey 4|promise|promisecb|promise回调

getOfflineReminderInfo

离线提醒开关查询

起始版本|适用平台 -|- 2.4.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|productKey|string|- string productKey 2|deviceKey|string|- string deviceKey 3|promise|promisecb|promise 回调

checkDeviceUpdatePlan

获取设备是否有OTA计划

起始版本|适用平台 -|- 2.4.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|device|object|- DeviceModel Object 设备信息 2|promise|promisecb|promise 回调

openDeviceOTAPage

打开设备OTA详情

起始版本|适用平台 -|- 2.4.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|productKey|string|- string productKey 2|deviceKey|string|- string deviceKey 3|promise|promisecb|promise 回调

getTimeDifferenceWithGMT

获取当前手机设置时区

起始版本|适用平台 -|- 2.5.7|all

序号|参数名|参数类型|描述 -|-|-|- 1|promise|promisecb|promise 执行回调

getDeviceTimeZone

获取当前设备设置时区

起始版本|适用平台 -|- 2.5.7|all

序号|参数名|参数类型|描述 -|-|-|- 1|productKey|string|- string productKey 2|deviceKey|string|- string deviceKey 3|promise|promisecb|promise 执行回调

setDeviceTimeZone

设置设备时区

起始版本|适用平台 -|- 2.5.7|all

序号|参数名|参数类型|描述 -|-|-|- 1|productKey|string|- string productKey 2|deviceKey|string|- string deviceKey 3|timezone|string|- string 时区 4|promise|promisecb|promise 执行回调

getDeviceStateInfo

获取设备当前连接WiFi信息

起始版本|适用平台 -|- 2.10.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|productKey|string|- string productKey 2|deviceKey|string|- string deviceKey 3|promise|promisecb|promise 执行回调

jumpDeviceWiFiListPage

跳转WiFi列表页

起始版本|适用平台 -|- 2.10.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|productKey|string|- string productKey 2|deviceKey|string|- string deviceKey 3|oldSsid|string|- string 已连接ssid 4|signal_strength|string|- string 信号强度 5|supportOnlineWiFiScan|boolean|- boolean 设备是否支持在线WiFi扫描 6|promise|promisecb|promise 执行回调

getProductDescription

获取产品说明书地址

起始版本|适用平台 -|- 2.10.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|productKey|string|- string productKey 2|promise|promisecb|promise 执行回调 { "data":{"url": "https://xxx.pdf"}}

getFamilyDeviceList

获取设备列表

起始版本|适用平台 -|- 2.11.5|all

序号|参数名|参数类型|描述 -|-|-|- 1|pageNumber|integer|number 页码 2|pageSize|integer|number 页大小 3|promise|promisecb|promise 执行回调callback {"data": {"list" : [], "total" : 12}}

timeZoneSync

设备校时 only pure bt

起始版本|适用平台 -|- 2.11.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|productKey|string|- string productKey 2|deviceKey|string|- string deviceKey 3|promise|promisecb|回调

unbindlingPureBtDevice

纯蓝牙设备解绑

起始版本|适用平台 -|- 2.11.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|productKey|string|- string productKey 2|deviceKey|string|- string deviceKey 3|isInit|boolean|- boolean 是否重置设备 4|random|string|- string 非必传 random 5|pureBtResetCredentials|string|- string 非必传 重置凭证 6|promise|promisecb|回调

getTsl

获取产品物模型(无网络获取缓存)

起始版本|适用平台 -|- 2.11.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|productKey|string|- string productKey 2|promise|promisecb|promise 执行回调

startVerifyDevice

激活设备(设备配网)

起始版本|适用平台 -|- 2.12.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|productKey|string|productKey 2|deviceKey|string|deviceKey 3|promise|promisecb|执行结果

startNetConfigDevice

已绑定设备配网

起始版本|适用平台 -|- 2.14.5|all

序号|参数名|参数类型|描述 -|-|-|- 1|productKey|string|productKey 2|deviceKey|string|deviceKey 3|promise|promisecb|执行结果

getSharePermList

被分享人查询分享权限

起始版本|适用平台 -|- 2.19.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|shareCodeList|Array<string>|分享码列表 2|promise|promisecb|执行结果

uploadDeviceHistoricalData

立刻上传设备历史数据

起始版本|适用平台 -|- 3.1.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|productKey|string|productKey 2|deviceKey|string|deviceKey 3|promise|promisecb|执行结果

getVoiceSupport

获取产品语音技能支持

起始版本|适用平台 -|- 3.2.0|all

序号|参数名|参数类型|描述 -|-|-|- 1|productKey|string|productKey 2|uid|string|终端用户id 3|account|string|当前用户的账号(优先邮箱 没有就手机号, 都没有就不传) 4|promise|promisecb|执行结果 callback {"supportAlexa": true/false, "supportAssistant": true/false,}supportAlexa 是否支持Alexa 语音supportAssistant 是否支持google assistant

事件

onDeviceConnectingState

设备链路连接状态状态通知

起始版本|适用平台 -|- 1.8.0|all

参数类型|描述 -|- object|事件数据 {"connectingState": 0/1/2/3/4/5/6/7}connectingStateMaskWS = 1 << 0,connectingStateMaskWifi = 1 << 1,connectingStateMaskBle = 1 << 2,(0: all offline, 1: websocket online, 2 : wifi online, 3: wifi + websocket online, 4: ble online, 5: websocket + ble online, 6: ble + wifi online , 7: wifi + ble + ws online)

onDeviceOnlineState

设备在离线状态通知

起始版本|适用平台 -|- 1.4.0|all

参数类型|描述 -|- object|事件数据 {"onlineState": 0/1/2/3/4/5/6/7}onlineStateMaskWS = 1 << 0,onlineStateMaskWifi = 1 << 1,onlineStateMaskBle = 1 << 2,(0: all offline, 1: websocket online, 2 : wifi online, 3: wifi + websocket online, 4: ble online, 5: websocket + ble online, 6: ble + wifi online , 7: wifi + ble + ws online)

onDeviceDpsUpdate

设备dps更新 (尽量)

起始版本|适用平台 -|- 1.4.0|all

参数类型|描述 -|- object|事件数据 {type: (1:ws 2: wifi 3: ble,)action: {1.读取消息(面板不需要处理)2.设备上报-读响应3.发生消息(面板不需要处理)4.设备上报-写响应5.调用 EXE-SERV2服务 (面板暂时不需要处理)6.设备上报-服务调用7.设备告警-info8.设备告警-warn9.设备告警-error10.位置信息LOCATION11.发生RAW (面板暂时不需要处理)12.接受RAW (面板暂时不需要处理)13.设备上报-自动上报14.设备在线状态 (面板不需要处理)15.设备上报-信号量16.设备上报-设备17.设备上报-设备被移除(value: 1 解绑, 2.重置, 3.分享过期, 4.取消分享, 5.覆盖分享, 6. 用户注销, 7. 从设备组中移除)18.设备状态信息回复19.透传数据方向 app → iot20.透传数据 方向 iot→ app}pk: "xxxx",dk: "xxxx","dps": [{id: 0, type:BOOL, value, true/false},{id: 1, type:INT, value, 1}, ...]"transparent": "xxx"(二进制数据base64后转字符串),}

onDeviceInfoUpdate

设备信息更新

起始版本|适用平台 -|- 1.4.0|all

参数类型|描述 -|- object|事件数据

onWebSocketDidOpen

WebSocket 已打开事件

起始版本|适用平台 -|- 1.0.0|all

参数类型|描述 -|- object|事件数据 data = {"code":"this is code", @"message":" this is reason"}reminder.data = {}

onWebSocketDidError

WebSocket 错误事件

起始版本|适用平台 -|- 1.0.0|all

参数类型|描述 -|- object|事件数据 data = {"code":"this is code", @"message":" this is reason"}

onWebSocketDidReceiveMessage

WebSocket 消息事件

起始版本|适用平台 -|- 1.0.0|all

参数类型|描述 -|- object|事件数据object.data = {"cmd": "message","data": {"createdAt": 1609316592000,"data": {"value": 1},"deviceKey": "866123456789015","productKey": "123456","ticket": "5f9924d171977c33bc5ad1b1","type": "ONLINE"}}error{cmd = error;data = {code = 4010;msg = "user not logged in";reqMsg = "";};

deviceAssociationSelected

设备关联选中的设备

起始版本|适用平台 -|- 2.0.0|all

参数类型|描述 -|- Array<object>|设备列表数组,Object是devcie model

onDeviceStatusUpdate

设备信息更新

起始版本|适用平台 -|- 2.10.0|all

参数类型|描述 -|- object|设备状态数据