文档
测试

查询1条记录

POST
{{host}}/api/device_type/limit

请求参数

参数名
类型
描述
必填
type_id
int
类型ID
可选
type_code
string
类型代码
可选

响应参数

参数名
类型
描述
必填
ret
int
返回码:0-正常,非0-失败
必填
msg
string
返回消息
必填
result
object
返回数据
必填
type_id
int
类型ID
必填
parent_type_id
int
父类型ID
必填
type_name
string
类型名称
必填
type_code
string
类型代码
必填
commands
object
设备指令集
必填
icon_content
object
图标内容
必填

说明 / 示例

###### 示例代码 ```javascript //请求 let res = await post("api/device_type/limit", { type_code: "LEDLight" }) //返回 res = { ret: 0, msg: "查询成功", result: { type_id: 2, parent_type_id: 1, type_name: "LED照明灯", type_code: "LEDLight", commands: [ "switch_query === {bt_address} 8201", "switch_ack === {bt_address} 8202 {onoff}", "switch === {bt_address} 8203 {onoff}" ], icon_content: { "icon": [ "/static/icons/light_0.png", "/static/icons/light_1.png", "/static/icons/light_error.png" ], "width": 24, "height": 24 } } } ```