fix(doc): add auto sub docs & more notes

This commit is contained in:
DDDHuang 2022-03-24 10:02:59 +08:00
parent 5a6023676e
commit ad12c3a4e3
2 changed files with 33 additions and 5 deletions

View File

@ -1,4 +1,21 @@
## When the device log in successfully,
## The auto-subscribe will complete the subscription for the device
## according to the preset topics list.
## Placeholders is supported.
##
## - ${clientid}
## - ${username}
## - ${host}
## - ${port}
##
## Subscription options can be set at the same time.
## Please refer to the official MQTT definition for these configuration items.
## - qos
## - rh
## - rap
## - nl
##
auto_subscribe {
topics = [
## {

View File

@ -34,11 +34,22 @@ fields("auto_subscribe") ->
];
fields("topic") ->
[ {topic, sc(binary(), #{example => topic_example()})}
, {qos, sc(emqx_schema:qos(), #{default => 0})}
, {rh, sc(range(0,2), #{default => 0})}
, {rap, sc(range(0, 1), #{default => 0})}
, {nl, sc(range(0, 1), #{default => 0})}
[ {topic, sc(binary(), #{
example => topic_example(),
desc => "Topic name, placeholders is supported. For example: "
++ binary_to_list(topic_example())})}
, {qos, sc(emqx_schema:qos(), #{
default => 0,
desc => "Quality of service. MQTT definition."})}
, {rh, sc(range(0,2), #{
default => 0,
desc => "Retain handling. MQTT 5.0 definition."})}
, {rap, sc(range(0, 1), #{
default => 0,
desc => "Retain as Published. MQTT 5.0 definition."})}
, {nl, sc(range(0, 1), #{
default => 0,
desc => "Not local. MQTT 5.0 definition."})}
].
topic_example() ->