Upgrade paho mqtt#3663
Open
benderl wants to merge 2 commits into
Open
Conversation
72c2670 to
afdce51
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR upgrades the project’s MQTT dependency (paho-mqtt) to v2.x and updates the codebase to use the v2 callback API, ensuring runtime compatibility with the new library behavior across internal broker helpers, modules, and standalone scripts.
Changes:
- Bump
paho_mqttfrom1.6.1to2.1.0. - Update MQTT callback signatures (e.g.,
on_connect) to the v2 form(client, userdata, flags, reason_code, properties). - Update MQTT client construction to explicitly opt into the v2 callback API via
callback_api_version=...VERSION2and useclient_id=where needed.
Reviewed changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| simpleAPI/simpleAPI_mqtt.py | Switches client creation to callback API v2 and updates connect/disconnect callback signatures. |
| runs/remoteSupport/remoteSupport.py | Updates client creation to callback API v2 and adjusts on_connect signature accordingly. |
| requirements.txt | Bumps paho_mqtt pin to 2.1.0. |
| packages/smarthome/smartcommon.py | Updates callback signature and ensures created clients opt into callback API v2 with client_id. |
| packages/modules/vehicles/mqtt/soc.py | Updates nested on_connect signature used with BrokerClient (now v2). |
| packages/modules/smarthome/mqtt/watt.py | Updates callback signature and client creation to callback API v2. |
| packages/modules/smarthome/mqtt/on.py | Updates callback signature and client creation to callback API v2. |
| packages/modules/smarthome/mqtt/off.py | Updates callback signature and client creation to callback API v2. |
| packages/modules/io_devices/eebus/api.py | Updates nested on_connect signature used with BrokerClient (v2). |
| packages/modules/io_devices/add_on/api.py | Updates IoStateManager.on_connect signature for BrokerClient v2 usage. |
| packages/modules/internal_chargepoint_handler/chargepoint_module.py | Updates nested on_connect signature used with BrokerClient (v2). |
| packages/modules/devices/generic/mqtt/device.py | Updates nested on_connect signature used with BrokerClient (v2). |
| packages/modules/chargepoints/mqtt/chargepoint_module.py | Updates nested on_connect signatures used with BrokerClient (v2). |
| packages/modules/chargepoints/external_openwb/chargepoint_module.py | Updates nested on_connect signature used with BrokerClient (v2). |
| packages/helpermodules/update_config.py | Updates on_connect signature to match BrokerClient v2 callback API. |
| packages/helpermodules/subdata.py | Updates on_connect signature to match BrokerClient v2 callback API. |
| packages/helpermodules/setdata.py | Updates on_connect signature to match BrokerClient v2 callback API. |
| packages/helpermodules/measurement_logging/write_log.py | Updates on_connect signature to match BrokerClient v2 callback API. |
| packages/helpermodules/data_migration/data_migration.py | Removes an unused broker helper class (no remaining references found). |
| packages/helpermodules/create_debug.py | Updates internal BrokerClient connect callbacks to the v2 signature. |
| packages/helpermodules/command.py | Updates on_connect signatures used with BrokerClient (v2). |
| packages/helpermodules/broker.py | Updates BrokerClient and InternalBrokerPublisher to create MQTT clients with callback API v2 and client_id=. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
LKuemmel
approved these changes
Jul 14, 2026
afdce51 to
5efef33
Compare
tpd-opitz
reviewed
Jul 16, 2026
| log.exception("Fehler im Werte-Logging-Modul für SmartHome") | ||
|
|
||
| def on_connect(self, client: MqttClient, userdata, flags: dict, rc: int): | ||
| def on_connect(self, client: MqttClient, userdata, flags, reason_code, properties): |
Contributor
There was a problem hiding this comment.
Schade, dass die Type-Info "dran glauben" musste...
Comment on lines
-51
to
+57
| self.client = mqtt.Client(f"openWB-python-bulk-publisher-{get_name_suffix()}") | ||
| self.client = mqtt.Client( | ||
| callback_api_version=mqtt.CallbackAPIVersion.VERSION2, | ||
| client_id=f"openWB-python-bulk-publisher-{get_name_suffix()}", | ||
| ) |
Contributor
There was a problem hiding this comment.
wäre dass nicht auch ein Kandidat für eine parametrisierte Funktion?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.