I’m experiencing a websocket incompatibility issue with the roonapi Python library when using recent versions of websocket-client.
Environment:
Python 3.14
roonapi (latest from PyPI)
websocket-client 1.9.0
Error:
ERROR roonapisocket – Error while parsing message ‘<websocket._app.WebSocketApp object at 0x…>’
AttributeError: ‘WebSocketApp’ object has no attribute ‘decode’
Issue: The error occurs in roonapisocket.py line 127, where the code attempts to call .decode(“utf-8”) on what appears to be a WebSocketApp object rather than a bytes object. This suggests the websocket-client library API has changed between versions.
Workaround: Downgrading to websocket-client==1.6.4 resolves the issue, but this creates conflicts with other packages (like Jupyter) that require websocket-client >= 1.7.
Question: Are there plans to update roonapi to support newer versions of websocket-client? Or is there a recommended approach for managing this dependency conflict?
@Michael_DePhillips I had a quick look - updated the library to websocket-client to 1.9.0 and tried to run my examples.
They all seemed to run fine.
I’ve started to look at releasing a new version - but since I haven’t touched the library or the build environment for a quite a while - will take a little work to get the build and dependencies to work correctly..
Hi
I had the same issue and pinned websocket-client to 1.6.4 in my project.
You’re right about the cause: the callback signature changed in recent websocket-client versions. The on_message callback receives the WebSocketApp object as first argument instead of just the message data. The roonapi library would need to update its callback functions to handle this, but until that happens…
The cleanest solution is to use a dedicated virtual environment for your roon stuff. That way the pinned version doesn’t conflict with Jupyter or anything else.
For my setup I went with this since the NFC controller runs in its own venv anyway. Works without any issues.