paho.mqtt.python
paho.mqtt.python copied to clipboard
Documentation does not mention differences in constructor/callback parameters for MQTTv5
It seems like the pydocs for paho-mqtt are missing a few details regarding the MQTTv5 protocol:
- The
on_connect()
callback handler appears to need an additionalproperties
parameter when used with v5. However the pydocs 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 theclean_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.
Is it possible to update the pydocs to reflect the above for v5?
This issue priority should be the highest. API documents must be correct. Some tutorials on Internet are updated with MQTTv5 but the number of arguments is still 5. http://www.steves-internet-guide.com/python-mqtt-client-changes/
- Confusing error when using the old example for connecting
raise ValueError('Clean session is not used for MQTT 5.0')
ValueError: Clean session is not used for MQTT 5.0
- Error on on_connect() callback
on_connect(self, self._userdata,
TypeError: func_on_connect_cb() takes from 4 to 5 positional arguments but 6 were given