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

Mismatched upper/lower case named arguments in launch-app-config #136

Open
ijuarezz opened this issue Feb 11, 2023 · 1 comment
Open

Mismatched upper/lower case named arguments in launch-app-config #136

ijuarezz opened this issue Feb 11, 2023 · 1 comment

Comments

@ijuarezz
Copy link

Mismatched upper/lower case named arguments in launch-app-config (e.g. APP_ID vs app_id)

when issuing:

root@localhost:~# /usr/local/bin/pyvizio --ip=xxx.xxx.xxx.xxx --device_type=tv --auth=xxxxxxxxxxx launch-app-config 4 3

error received:

TypeError: launch_app_config() got an unexpected keyword argument 'app_id'

complete error:

Traceback (most recent call last):
File "/usr/local/bin/pyvizio", line 8, in
sys.exit(cli())
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1128, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/pyvizio/helpers.py", line 13, in wrapper
return asyncio.run(f(*args, **kwargs))
File "/usr/local/lib/python3.9/dist-packages/click/decorators.py", line 84, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
TypeError: launch_app_config() got an unexpected keyword argument 'app_id'

My knowledge of Python is very basic so I patched the error by changing all the named arguments in cli.py to lower case

FILE: /usr/local/lib/python3.9/dist-packages/pyvizio/cli.py
LINE: async def launch_app_config(...

OLD: vizio: VizioAsync, APP_ID: str, NAME_SPACE: int, MESSAGE: str
NEW: vizio: VizioAsync, app_id: str, name_space: int, message: str

I also replaced all subsequent referenecs to this arguments within that same function

@philipp
Copy link

philipp commented Sep 29, 2024

I had exactly the same problem, and I'm fixing it the same way.
I've created a pull request to this repo: #165

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

No branches or pull requests

2 participants