catt icon indicating copy to clipboard operation
catt copied to clipboard

catt info not working, 'CastStatus' object has no attribute '_asdict'

Open 0-andy-0 opened this issue 1 year ago • 6 comments

After an update it seems everything is working except "catt info" - have I done something silly?

Traceback (most recent call last): File "/usr/bin/catt", line 8, in sys.exit(main()) ^^^^^^ File "/usr/lib/python3.12/site-packages/catt/cli.py", line 667, in main return cli(obj=get_config_as_dict()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/click/core.py", line 1157, in call return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/click/core.py", line 783, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/click/decorators.py", line 45, in new_func return f(get_current_context().obj, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/catt/cli.py", line 490, in info info = cst.info ^^^^^^^^ File "/usr/lib/python3.12/site-packages/catt/controllers.py", line 303, in info status.update(self._cast.status._asdict()) ^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'CastStatus' object has no attribute '_asdict'

0-andy-0 avatar May 04 '24 11:05 0-andy-0

I also ran into the same issue. Did you have any luck fixing this?

I wonder if it's compatibility issue with python 3.12.

vredesbyyrd avatar Jul 11 '24 04:07 vredesbyyrd

no, I found no fix... odd that everything except status seems to work

0-andy-0 avatar Jul 11 '24 07:07 0-andy-0

It looks like pychromecast release 14.0.0 had many breaking changes. I do not know catt or pychromecasts codebase enough to know for sure, but I do wonder if the following change could be responsible:

Most user facing functions accepting an optional callback function have been changed such that the optional arguments are now kwarg only

As a workaround, downgrading pychromecast to 13.1.0 works for me. If I have time I may dig into the issue more.

vredesbyyrd avatar Jul 11 '24 17:07 vredesbyyrd

For those of you who installed catt with pipx, you can downgrade pychromecast like this:

pipx inject catt pychromecast==13.1.0

na-ji avatar Mar 05 '25 19:03 na-ji