如何通过 lua 添加命名的 UCI 部分?

How to add a named UCI section via lua?

我无法通过 lua 创建命名的 UCI 部分。 使用命令行的等价物是

uci set uhttpd.test=uhttpd
uci commit

它给出了一个类似

的配置文件
config uhttpd 'test'

我无法使用 setadd 重现命令行的语法。 C source 似乎说有一种方法可以将类型传递给 add

local uci = require "uci"
uci.add("uhttpd", "test") -- adds anonymous section
uci.set("uhttpd", "test", "listen_http", "0.0.0.0:81") -- not added as named section missing
uci.commit("uhttpd")

来自维基:

Add new section "name" with type "type":
x:set("config", "name", "type")
-- real world example:
x:set("network", "wan6", "interface")

https://wiki.openwrt.org/doc/techref/uci