Repository navigation
Upgrade paho mqtt - #3663
Upgrade paho mqtt#3663benderl wants to merge 2 commits into
Conversation
72c2670 to
afdce51
Compare
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.
afdce51 to
5efef33
Compare
| 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): |
There was a problem hiding this comment.
Schade, dass die Type-Info "dran glauben" musste...
There was a problem hiding this comment.
Der PR hat sich leider als Problem herausgestellt, wenn ein älteres Backup eingespielt wird. Die Anpassungen kommen im Zuge der Umstellung auf ein VENV mit rein. Dann spendiere ich auch die Typehints wieder.
| 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()}", | ||
| ) |
There was a problem hiding this comment.
wäre dass nicht auch ein Kandidat für eine parametrisierte Funktion?
|
Moved into VENV. |
No description provided.