jath03 / openrgb-python

A python client for the OpenRGB SDK
GNU General Public License v3.0
115 stars 22 forks source link

Cannot load local profiles #27

Closed rockerbacon closed 3 years ago

rockerbacon commented 3 years ago

LocalProfile.unpack is returning None which makes the loading of a local profile fail. Loading the exact same profile from the server works fine.

Here's the terminal output of the error:

Traceback (most recent call last):
  File "/home/vitor/.local/bin/load-rgb-profile", line 6, in <module>
    client.load_profile('default', True)
  File "/home/vitor/.local/lib/python3.9/site-packages/openrgb/orgb.py", line 339, in load_profile
    controllers = utils.LocalProfile.unpack(f).controllers
AttributeError: 'NoneType' object has no attribute 'controllers'

The profile was created in the OpenRGB GUI, I've attached it below: default.zip

A quick look at the unpack code suggests it does not support the file version.

rockerbacon commented 3 years ago

The profile version was bumped to 2 in this commit. The current unpack function only supports version 1.

EDIT: there seems to have been no change other than version numbers so the current function should properly support version 2 as well. I'll give it a quick test and report back the results

rockerbacon commented 3 years ago

Attempting to load version 2 profiles using the code for version 1 did not work.

jath03 commented 3 years ago

Does that fix it?