Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors with version 0.16.1 -> SRS-XB402g #152

Closed
ABrauser opened this issue Mar 15, 2024 · 6 comments · Fixed by #153
Closed

Errors with version 0.16.1 -> SRS-XB402g #152

ABrauser opened this issue Mar 15, 2024 · 6 comments · Fixed by #153

Comments

@ABrauser
Copy link

Hello, maybe someone can help me with a issue. Im facing problems with the latest songpal version:

In Version 0.15.2 everything was working fine, here an example:

PS C:\Users\johndoe\Desktop\TROUBLESHOOT\python-songpal-release-0.15.2> songpal --endpoint http://srs-xb402g.local.net:10000/sony power
Power on

after the Update to 0.16.1 im faceing the following issues:

PS C:\Users\johndoe\Desktop\TROUBLESHOOT\python-songpal-release-0.16.1> songpal --endpoint http://srs-xb402g.local.net:10000/sony power
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\johndoe\AppData\Local\Programs\Python\Python312\Scripts\songpal.exe\__main__.py", line 7, in <module>
  File "C:\Users\johndoe\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\johndoe\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "C:\Users\johndoe\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\core.py", line 1685, in invoke
    super().invoke(ctx)
  File "C:\Users\johndoe\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\johndoe\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\johndoe\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\johndoe\AppData\Local\Programs\Python\Python312\Lib\site-packages\songpal\main.py", line 50, in wrapper
    return loop.run_until_complete(f(*args, **kwargs))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\johndoe\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 685, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "C:\Users\johndoe\AppData\Local\Programs\Python\Python312\Lib\site-packages\songpal\main.py", line 145, in cli
    await x.get_supported_methods()
  File "C:\Users\johndoe\AppData\Local\Programs\Python\Python312\Lib\site-packages\songpal\device.py", line 145, in get_supported_methods
    serv = await Service.from_payload(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\johndoe\AppData\Local\Programs\Python\Python312\Lib\site-packages\songpal\service.py", line 116, in from_payload
    methods[api["name"]].add_supported_version(v["version"])
    ~~~~~~~^^^^^^^^^^^^^
KeyError: 'getVolumeINformation'

would it be possible to fix that issue in a new version?

@rytilahti
Copy link
Owner

The casing looks odd, as that method is actually called getVolumeInformation, which is probably why it's breaking here. @allistermaguire any thoughts on this? Maybe we could canonicalize the names, or alternatively just guard that access to avoid crashing?

@allistermaguire
Copy link
Contributor

@rytilahti I will have a look and create a PR.

@allistermaguire
Copy link
Contributor

@ABrauser this should fix it, if you can please try installing this version and let me know?

pip3 install git+https://github.com/allistermaguire/python-songpal.git@0.16.2

@allistermaguire
Copy link
Contributor

Hey @ABrauser, have you had a chance to test if this version fixes you issue?

@ABrauser
Copy link
Author

ABrauser commented Mar 22, 2024

@allistermaguire looks now better:

PS C:\Users\johndoe\Desktop\TROUBLESHOOT> songpal --endpoint http://srs-xb402g.local.net:10000/sony power
INFO:songpal.service:No matching method getVolumeINformation for supported version 1.1.
Power on
PS C:\Users\johndoe\Desktop\TROUBLESHOOT> songpal --endpoint http://srs-xb402g.local.net:10000/sony power off
INFO:songpal.service:No matching method getVolumeINformation for supported version 1.1.
True
PS C:\Users\johndoe\Desktop\TROUBLESHOOT> songpal --version
songpal, version 0.16.2
PS C:\Users\johndoe\Desktop\TROUBLESHOOT>

@allistermaguire
Copy link
Contributor

Thanks @ABrauser. There is another issue that is being investigated, so a new release probably won't be released straight away. Then it will need to be bumped in HA. It will likely miss 2024.4.0 at this stage, but you never know.

You can continue to use this version with HA manually for now.

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 a pull request may close this issue.

3 participants