Skip to content

Upgrade paho mqtt#3663

Open
benderl wants to merge 2 commits into
openWB:masterfrom
benderl:upgrade-paho-mqtt
Open

Upgrade paho mqtt#3663
benderl wants to merge 2 commits into
openWB:masterfrom
benderl:upgrade-paho-mqtt

Conversation

@benderl

@benderl benderl commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_mqtt from 1.6.1 to 2.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=...VERSION2 and use client_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.

@benderl benderl requested a review from LKuemmel July 14, 2026 11:35
@benderl benderl force-pushed the upgrade-paho-mqtt branch from afdce51 to 5efef33 Compare July 16, 2026 10:32
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):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()}",
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wäre dass nicht auch ein Kandidat für eine parametrisierte Funktion?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants