Skip to content

fix and update code to run on current library versions#1

Open
mdecker wants to merge 1 commit intom-ri:masterfrom
mdecker:master
Open

fix and update code to run on current library versions#1
mdecker wants to merge 1 commit intom-ri:masterfrom
mdecker:master

Conversation

@mdecker
Copy link
Copy Markdown

@mdecker mdecker commented Jun 29, 2021

Hi, thanks for your code. I needed to make some changes to have it run on my system. I assume it might be because of changes to the mqtt library or server over the past 3+ years. In any case: This code works for me. So feel free to merge it.

Key changes I made:

  • move subscribe to on_connect
  • only subscribe to topics actually required
  • fix number of expected topics
  • move QoS setting and number of expected topics to top-level scope
  • only print performance data when all required data is available (avoids KeyError)

tested with: mosquitto 2.0.11, paho-mqtt 1.4.0, Debian 10

- move subscribe to on_connect
- only subscribe to topics actually required
- fix number of expected topics
- move QoS setting and number of expected topics to top-level scope
- only print performance data when all required data is available (avoids KeyError)

tested with: mosquitto 2.0.11, paho-mqtt 1.4.0, Debian 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant