Skip to content

Commit

Permalink
Remedy breaking change with 2.x: Use CallbackAPIVersion.VERSION1
Browse files Browse the repository at this point in the history
Use `callback_api_version = CallbackAPIVersion.VERSION1` as a default,
to not unnecessarily cause downstream havocs.

In this way, users can run their code with both versions of paho-mqtt
1.x and 2.x, which will significantly improve adoption rates.
  • Loading branch information
amotl committed Mar 29, 2024
1 parent 28aa2e6 commit 1a05ea7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/paho/mqtt/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ def on_connect(client, userdata, flags, reason_code, properties):

def __init__(
self,
callback_api_version: CallbackAPIVersion,
callback_api_version: CallbackAPIVersion = CallbackAPIVersion.VERSION1,
client_id: str | None = "",
clean_session: bool | None = None,
userdata: Any = None,
Expand Down

0 comments on commit 1a05ea7

Please sign in to comment.