Commit f176697e authored by Alexis Lothoré's avatar Alexis Lothoré Committed by Marcel Stör
Browse files

Document user/pass as optional in MQTT client doc (#1727)

parent 46dc9eae
...@@ -11,7 +11,7 @@ The client adheres to version 3.1.1 of the [MQTT](https://en.wikipedia.org/wiki/ ...@@ -11,7 +11,7 @@ The client adheres to version 3.1.1 of the [MQTT](https://en.wikipedia.org/wiki/
Creates a MQTT client. Creates a MQTT client.
#### Syntax #### Syntax
`mqtt.Client(clientid, keepalive, username, password[, cleansession])` `mqtt.Client(clientid, keepalive[, username, password, cleansession])`
#### Parameters #### Parameters
- `clientid` client ID - `clientid` client ID
...@@ -25,7 +25,10 @@ MQTT client ...@@ -25,7 +25,10 @@ MQTT client
#### Example #### Example
```lua ```lua
-- init mqtt client with keepalive timer 120sec -- init mqtt client without logins, keepalive timer 120s
m = mqtt.Client("clientid", 120)
-- init mqtt client with logins, keepalive timer 120sec
m = mqtt.Client("clientid", 120, "user", "password") m = mqtt.Client("clientid", 120, "user", "password")
-- setup Last Will and Testament (optional) -- setup Last Will and Testament (optional)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment