Description

  • Description of the led widget

Interface version

Version number Writer Date Description
1.0 Qin Zhitian June 29, 2021 initial release

IP address

http://192.168.1.1/wapi

API list

Name Description
set set attributes
get get attributes

1. set

Description of request parameters

Parameter Name Type Description
attr string attribute
attr.action string action:on-‘turn on led’;off-‘turn off led’; bright-‘set brightness’;
attr.value int parameter: led brightness

Call example

{
    "wid": "s1",
    "cmd" : "set",
    "attr": {
        "action": "on"
    }
}
Note: set led to be on;
{
    "wid": "s1",
    "cmd" : "set",
    "attr": {
            "action": "off"
    }
}
Note: set led to be off;
{
    "wid": "s1",
    "cmd" : "set",
    "attr": {
            "action": "bright",
            "value": "200",
    }
}
Note: set the brightness of led to 200;

Return example

{
    "code": 0
}

Description of return parameters

Parameter Name Type Description
result string result information
result.code int error code

Error Code

Error Code Description

2. get

Description of request parameters

Parameter Name Type Description

Call example

{
    "wid": "s1",
    "cmd" : "get"
}

Return example

{
    "number": 200,
    "code": 0
}

Description of return parameters

Parameter Name Type Description
result string result information
result.code int error code
result.number int led brightness

Error Code

Error Code Description
文档更新时间: 2021-08-19 14:28   作者:plj