Description

  • Description of the button widget

Interface version

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

IP address

http://192.168.1.1/wapi

API list

Name Description
set set attributes

1. set

Description of request parameters

Parameter Name Type Description
attr string attribute
attr.action string action:click-‘click-event trigger’;set_state-‘set btn state’;
attr.state string state:on-‘set btn to enabled’;off-‘Set btn to disabled’;

Call example

{
    "wid": "s1",
    "cmd" : "set",
    "attr": {
        "action": "click"
    }
}
Note: click the button to trigger event callback;
{
    "wid": "s1",
    "cmd" : "set",
    "attr": {
        "action": "set_state",
        "state": "on",
    }
}
Note: set the button to enabled;
{
    "wid": "s1",
    "cmd" : "set",
    "attr": {
        "action": "set_state",
        "state": "off",
    }
}
Note: set the button to disabled;

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

{
    "state": true,
    "code": 0
}

Description of return parameters

Parameter Name Type Description
result string result information
result.code int error code
result.state bool get btn state

Error Code

Error Code Description
文档更新时间: 2021-08-18 18:49   作者:plj