From 147bfd689e8e333ba133f3032a5833a2223470df Mon Sep 17 00:00:00 2001 From: Goosneck <88941571+Goosneck@users.noreply.github.com> Date: Wed, 19 Jul 2023 00:20:20 +0300 Subject: [PATCH] Fixed README.md A part of the code was not working since it did not call to any variable in the mqtt module (on line 385) Adding "mqtt_" would make it call a viable variable --- 1-getting-started/lessons/4-connect-internet/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-getting-started/lessons/4-connect-internet/README.md b/1-getting-started/lessons/4-connect-internet/README.md index 5ca932af..2ad69a99 100644 --- a/1-getting-started/lessons/4-connect-internet/README.md +++ b/1-getting-started/lessons/4-connect-internet/README.md @@ -382,7 +382,7 @@ The next step for our Internet controlled nightlight is for the server code to s command = { 'led_on' : payload['light'] < 300 } print("Sending message:", command) - client.publish(server_command_topic, json.dumps(command)) + mqtt_client.publish(server_command_topic, json.dumps(command)) ``` This sends a JSON message to the command topic with the value of `led_on` set to true or false depending on if the light is less than 300 or not. If the light is less than 300, true is sent to instruct the device to turn the LED on.