From f176697e13b1e68187bb5bb2358fbd5829133aeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20Lothor=C3=A9?= Date: Sun, 15 Jan 2017 19:27:56 +0100 Subject: [PATCH] Document user/pass as optional in MQTT client doc (#1727) --- docs/en/modules/mqtt.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/en/modules/mqtt.md b/docs/en/modules/mqtt.md index 403777fd..04e6a4bd 100644 --- a/docs/en/modules/mqtt.md +++ b/docs/en/modules/mqtt.md @@ -11,7 +11,7 @@ The client adheres to version 3.1.1 of the [MQTT](https://en.wikipedia.org/wiki/ Creates a MQTT client. #### Syntax -`mqtt.Client(clientid, keepalive, username, password[, cleansession])` +`mqtt.Client(clientid, keepalive[, username, password, cleansession])` #### Parameters - `clientid` client ID @@ -25,7 +25,10 @@ MQTT client #### Example ```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") -- setup Last Will and Testament (optional)