mqtt CallbackAPIVersion fix for paho.mqtt >= 2.0.0 #386
No reviewers
Labels
No labels
architecture
authentication
backend
bug
ci/cd
cleanup
documentation
duplicate
enhancement
good first issue
help wanted
in progress
invalid
media
mobile
new feature
packaging
question
ui
voice
waiting user input
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: platypush/platypush#386
Loading…
Reference in a new issue
No description provided.
Delete branch "revil-O/platypush:master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
fix to work with paho.mqtt >= 2.0.0
Good catch! I missed this breaking change in paho.mqtt 2.0.0.
Let me quickly test it with paho.mqtt < 2.0.0 to make sure that it still works as expected.
I'm afraid it won't work on paho.mqtt < 2.0.0 because of different constructor signature + non-existing
CallbackAPIVersion
enum:I wish that
callback_api_version
had been an optional parameter withVERSION1
default rather than implemented as such a hard breaking change.Since Platypush still supports older distros and versions of Python, and since probably it'll take a while for paho-mqtt 2.x to reach upstream in most of the distros, I'd propose to add a conditional logic that either checks
paho.mqtt.__version__
or ifpaho.mqtt.CallbackAPIVersion
exists, so everything should work with both versions.@revil-O I've added a commit that introduces a compatibility layer for all versions of paho.mqtt - basically it looks if
paho.mqtt.CallbackAPIVersion
exists and initializes the constructor accordingly.Thanks for your contribution!
Hi, sorry for incomplete pull-request; i forgot to test paho-mqtt < 2.0.0.
thx to blacklight for complete test and implementation !
greets