Fix AttributeError for paho-mqtt < 2.0 compatibility (#321)

When paho-mqtt < 2.0 is installed (e.g. in cached Docker layers),
mqtt.CallbackAPIVersion does not exist, causing an immediate crash on
startup with:

  AttributeError: module 'paho.mqtt.client' has no attribute 'CallbackAPIVersion'

Add try/except fallback so the addon works with both paho-mqtt 1.x and
2.x, eliminating the crash and allowing the addon to start correctly.

Co-authored-by: Barry Jarman <bazza@Barrys-Mac-mini.local>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
bazza2000
2026-05-15 09:09:26 +02:00
committed by GitHub
co-authored by Barry Jarman Copilot
parent 76cfa21db7
commit 48663d2e0d
2 changed files with 13 additions and 3 deletions
+6
View File
@@ -1,3 +1,9 @@
## v1.13.4
### 🐛 Bug Fixes:
- Fix `AttributeError: module 'paho.mqtt.client' has no attribute 'CallbackAPIVersion'` when paho-mqtt < 2.0 is installed
## v1.13.3
### 🐛 Bug Fixes: