Skip to content

Commit

Permalink
docs: clarify paho version & fix typo (#1146)
Browse files Browse the repository at this point in the history
Co-authored-by: Florence Njeri <[email protected]>%0ACo-authored-by: Lukasz Gornicki <[email protected]>
  • Loading branch information
GavinZhengOI and derberg authored Mar 27, 2024
1 parent 4cf8f69 commit 0b7dd90
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/generator-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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**.
Expand Down

0 comments on commit 0b7dd90

Please sign in to comment.