文档
测试
POST
{{host}}/api/device_type/add

请求参数

参数名
类型
描述
必填
parent_type_id
int
父类型ID
必填
type_name
string
类型名称
必填
type_code
string
类型代码
必填
commands
object
设备指令集
必填
icon_content
object
图标内容
必填

响应参数

参数名
类型
描述
必填
ret
int
返回码:0-正常,非0-失败
必填
msg
string
返回消息
必填

说明 / 示例

###### 示例代码 ```javascript //请求 let res = await post("api/device_type/add", { parent_type_id:0, 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 } }) //返回 res = { ret: 0, msg: "新增成功" } ```