From 0b7dd90a45d8115fb9a693f660d3e3784a8e292f Mon Sep 17 00:00:00 2001 From: GavinZhengOI <33168669+GavinZhengOI@users.noreply.github.com> Date: Wed, 27 Mar 2024 05:06:14 -0400 Subject: [PATCH] docs: clarify paho version & fix typo (#1146) Co-authored-by: Florence Njeri <40742916+Florence-Njeri@users.noreply.github.com>%0ACo-authored-by: Lukasz Gornicki --- docs/generator-template.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/generator-template.md b/docs/generator-template.md index da10e6f6a..7901d0bbe 100644 --- a/docs/generator-template.md +++ b/docs/generator-template.md @@ -196,7 +196,8 @@ class TemperatureServiceClient: self.client.publish(topic, id) ``` -Make sure you have the Paho-MQTT library installed. You can install it using pip with the `pip install paho-mqtt` command. +Make sure you have the Paho-MQTT library installed. You can install it using pip with the `pip install paho-mqtt==1.6.1` command. Please note that this tutorial is based on Paho-MQTT version 1.6.1. The Paho-MQTT library has since been updated to version 2.0.0, which includes changes that are not covered in this tutorial. To ensure compatibility and to follow along without any issues, please install version 1.6.1 of the Paho-MQTT library. + Let's break down the previous code snippet: 1. Imports the MQTT module from the Paho package, which provides the MQTT client functionality. @@ -331,7 +332,7 @@ Generator Error: This template requires the following missing params: server. Update your `test:generate` script in **package.json** to include the server param ```json -test:generate": "asyncapi generate fromTemplate test/fixtures/asyncapi.yml ./ --output test/project --force-write --param server=dev" +"test:generate": "asyncapi generate fromTemplate test/fixtures/asyncapi.yml ./ --output test/project --force-write --param server=dev" ``` You can now replace the static broker from `mqttBroker = 'test.mosquitto.org'` to `mqttBroker = "${asyncapi.servers().get(params.server).url()}"` in **index.js**.