eclipse-paho / eclipse-paho/paho.mqtt.python

Documentation does not mention differences in constructor/callback parameters for MQTTv5

Open
#642 1 comment 6 reactions 0 assignees View on GitHub
Status: Available Type: Maintenance
Dominant language
Python
Stars
2.4k
Forks
742
Avg merge
12d 48m
Merged PRs (30d)
1

Description

It seems like the [pydocs for paho-mqtt](https://pypi.org/project/paho-mqtt/) are missing a few details regarding the MQTTv5 protocol:

* The `on_connect()` callback handler appears to need an additional `properties` parameter when used with v5. However the [pydocs](https://pypi.org/project/paho-mqtt/#callbacks) don't mention this at all which leads to a confusing exception:
`TypeError: _on_connect() takes 5 positional arguments but 6 were given`
* It looks like the `Client()` constructor doesn't support/allow the `clean_session` parameter at all with v5. Although the exception _does_ make this clear (`ValueError: Clean session is not used for MQTT 5.0`) this is not mentioned at all [in the pydocs for the constructor](https://pypi.org/project/paho-mqtt/#constructor-reinitialise).

Is it possible to update the pydocs to reflect the above for v5?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.