Skip to content

Pin Paho to <2.0.0#164

Closed
digitalgravy wants to merge 1 commit intoNickduino:masterfrom
digitalgravy:patch-1
Closed

Pin Paho to <2.0.0#164
digitalgravy wants to merge 1 commit intoNickduino:masterfrom
digitalgravy:patch-1

Conversation

@digitalgravy
Copy link
Copy Markdown

Paho has recently been updated to 2.0.0 and has broken the current API. Some details can be found in this issue: eclipse-paho/paho.mqtt.python#814

journalctl -u shutters.service -e will show this output if Paho 2.0.0 is installed and the instruction on Pi-Somfy's readme are followed:

Exception in thread MQTT:
Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
    self.run()
 * Serving Flask app 'WebServer'
  File "/home/stue/Pi-Somfy/mymqtt.py", line 149, in run
 * Debug mode: off
    self.t = paho.Client(mqtt_client.CallbackAPIVersion.VERSION1, self.config.MQTT_ClientID)
NameError: name 'mqtt_client' is not defined

This change pins Paho to < 2.0.0 thus avoiding this error.

If anyone would like to update Pi-Somfy to use Paho >= 2.0.0 then there are some instructions to follow: https://github.com/eclipse/paho.mqtt.python/blob/master/docs/migrations.rst

MichaelB2018 added a commit to MichaelB2018/Pi-Somfy that referenced this pull request Mar 26, 2026
- mymqtt.py: Support both paho-mqtt 1.x and 2.x by detecting
  CallbackAPIVersion (addresses PR Nickduino#164 by @digitalgravy)
- myconfig.py: Uppercase shutterId when writing rolling codes to prevent
  duplicate config entries with hex IDs (addresses PR Nickduino#156 by @gbsallery
  and PR Nickduino#159 by @malys)
- README.md: Credit community contributors
- Add .github/agents/pi-somfy.agent.md for development workflow
@MichaelB2018
Copy link
Copy Markdown
Collaborator

Superseded by #170. All changes from this PR have been incorporated into the modernization PR.

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.

2 participants