publishThingModelMessage(params: Object)
版本要求:
DeviceKit≥2.0.7@ray-js/ray≥0.6.23
支持平台:
iOSAndroid
描述
通过物模型投递消息
参数
| 属性 | 类型 | 必填 | 说明 |
|---|---|---|---|
devId | string | 是 | 设备id |
type | number | 是 | 类型 0:属性, 1:动作, 2:事件 |
| 是 | 物模型投递消息体,结构随 type 不同而变化,示例如下: Example: type == property: payload = { "color":"green", "brightness": 50 } type == action: payload = { "actionCode": "testAction", "inputParams": { "inputParam1":"value1", "inputParam2":"value2" } } | ||
complete | () => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
success | () => void | 否 | 接口调用成功的回调函数 |
fail | (params: Object) => void | 否 | 接口调用失败的回调函数 |
fail 回调参数
| 属性 | 类型 | 说明 |
|---|---|---|
errorMsg | string | 错误信息 |
errorCode | string | number | 错误码 |
| 错误扩展 |
返回值
无