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

This commit is contained in:
Alexis Lothoré 2017-01-15 19:27:56 +01:00 committed by Marcel Stör
parent 46dc9eaeb3
commit f176697e13
1 changed files with 5 additions and 2 deletions

View File

@ -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
#### 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)