Open smuskiew opened 2 years ago
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
It seems like the pydocs for paho-mqtt are missing a few details regarding the MQTTv5 protocol:
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
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?