文档
测试

查询N条记录

POST
{{host}}/api/light_button/query

请求参数

参数名
类型
描述
必填
level_id
int
层级ID
必填
client_display
enum
客户端是否显示,0-隐藏,1-显示
可选

响应参数

参数名
类型
描述
必填
ret
int
返回码:0-正常,非0-失败
必填
msg
string
返回消息
必填
result
array
返回数据
必填
button_id
int
按钮ID
必填
button_name
string
层级控制按钮名称
必填
level_id
int
层级ID
必填
loop_config
array
配电回路
必填
group_config
array
蓝牙分组
必填
status
int
按钮状态,0未激活,1激活
必填
client_display
enum
客户端是否显示,0-隐藏,1-显示
必填
sequence
int
排序字段,asc排序,默认0
必填

说明 / 示例

###### 示例代码 ```javascript //请求 let res = await post("api/light_button/query", { level_id: 1 }) //返回 res = { "ret": 0, "msg": "查询成功", "result": [{ "button_id": 23, "button_name": "全部开启", "level_id": 169, "loop_config": [{ "label": "回路1", "checked": true, "control": { "status": 1, "command": "switch", "loop_id": 31, "device_type": "LoopController_6" } }, { "label": "回路3", "checked": false, "control": { "status": 0, "command": "switch", "loop_id": 33, "device_type": "LoopController_6" } }], "group_config": [{ "label": "[C06B] 全部", "control": { "status": 6, "command": "dimming", "bt_group_id": 58, "device_type": "MeshDimmingController" } }], "status": 1, "client_display": 1, "sequence": 0 }, { "button_id": 22, "button_name": "1111", "level_id": 169, "loop_config": [{ "label": "回路1", "checked": false, "control": { "status": 0, "command": "switch", "loop_id": 31, "device_type": "LoopController_6" } }, { "label": "回路3", "checked": false, "control": { "status": 0, "command": "switch", "loop_id": 33, "device_type": "LoopController_6" } }], "group_config": [{ "label": "[C06B] 全部", "checked": false, "control": { "status": 0, "command": "dimming", "bt_group_id": 58, "device_type": "MeshDimmingController" } }], "status": 0, "client_display": 1, "sequence": 0 }, { "button_id": 21, "button_name": "2222", "level_id": 169, "loop_config": [{ "label": "回路1", "checked": false, "control": { "status": 0, "command": "switch", "loop_id": 31, "device_type": "LoopController_6" } }, { "label": "回路3", "checked": false, "control": { "status": 0, "command": "switch", "loop_id": 33, "device_type": "LoopController_6" } }, { "label": "回路2", "checked": false, "control": { "status": 0, "command": "switch", "loop_id": 32, "device_type": "LoopController_6" } }], "status": 0, "group_config": [], "client_display": 1, "sequence": 0 }, { "button_id": 19, "button_name": "全部开启", "level_id": 169, "loop_config": [{ "label": "回路1", "checked": true, "control": { "status": 1, "command": "switch", "loop_id": 31, "device_type": "LoopController_6" } }, { "label": "回路2", "checked": true, "control": { "status": 1, "command": "switch", "loop_id": 32, "device_type": "LoopController_6" } }, { "label": "回路3", "checked": true, "control": { "status": 1, "command": "switch", "loop_id": 33, "device_type": "LoopController_6" } }], "status": 0, "group_config": [], "client_display": 1, "sequence": 1 }, { "button_id": 18, "button_name": "全部关闭", "level_id": 169, "loop_config": [{ "label": "回路1", "checked": false, "control": { "status": 0, "command": "switch", "loop_id": 31, "device_type": "LoopController_6" } }, { "label": "回路2", "checked": false, "control": { "status": 0, "command": "switch", "loop_id": 32, "device_type": "LoopController_6" } }, { "label": "回路3", "checked": false, "control": { "status": 0, "command": "switch", "loop_id": 33, "device_type": "LoopController_6" } }], "status": 0, "group_config": [], "client_display": 1, "sequence": 2 }] } ```