目录

更新规则

适用平台

Android、iOS

接口描述

hilink.updateRule(String jsonString, final String resultCallback)

更新任务执行的规则。

请求参数

参数

类型

描述

jsonString

String

符合规则接口的json字符串

resultCallback

String

回调函数的方法名

jsonString数据参考格式:

{
    "name": "Rule01",
    "description": "string""conditions": [
        {
            "type": "DEVICE_DATA",
            "deviceInfo": {
                "devId": "2323-1221-...",
                "devType": "005",
                "path": "switch/on"
            },
            "operator": "=",
            "value": "1"
        }
    ]"author": "12222",
    "actions": [
        {
            "type": "DEVICE_CMD",
            "devId": "2323-1221-...",
            "devType": "01B",
            "cmd": {
                "sid": "switch",
                "messageType": "POST",
                "messageBody": {
                    "on": 1
                }
            }
        }
    ]
}

返回参数

{
    "ruleId": "*******",
    "name": "Rule01",
    "conditions": [
        {
            "id": "****",
            "type": "DEVICE_DATA",
            "deviceInfo": {
                "devId": "2323-1221-...",
                "devType": "005",
                "path": "switch/on"
            },
            "operator": "=",
            "value": "1"
        }
    ],
    "author": "12222",
    "actions": [
        {
            "type": "DEVICE_CMD",
            "id": "****",
            "devId": "2323-1221-...",
            "devType": "01B",
            "cmd": {
                "sid": "switch",
                "messageType": "POST",
                "messageBody": {
                    "on": 1
                }
            }
        }
    ]
}