klattimer / LGWebOSRemote

Command line webOS remote for LGTVs
MIT License
511 stars 99 forks source link

KeyError "MyTV" #142

Closed Bobby4Life closed 9 months ago

Bobby4Life commented 10 months ago

Hi there,

need help with LG C2 connected to a Mac mini. Followed the instructions and when typing in any command I get the following KeyError:

"bobbys@Mac-mini-from-Bobby ~ % lgtv --name MyTV --ssl swInfo Traceback (most recent call last): File "/Users/bobbys/.local/bin/lgtv", line 10, in sys.exit(main()) ^^^^^^ File "/Users/bobbys/Library/Application Support/pipx/venvs/lgtv/lib/python3.12/site-packages/LGTV/init.py", line 184, in main ws = LGTVRemote(name, **config[name], ssl=args.ssl)


KeyError: 'MyTV'
bobbyss@Mac-mini-from-Bobby ~ % "
Tenzer commented 9 months ago

"MyTV" is only shown as an example. You should use whichever name you specified for the lgtv auth command. You can also check the name in the configuration file that likely was written to ~/.lgtv/config.json in case you can't recall.

klattimer commented 9 months ago

@Tenzer for for usability purposes, catching this error and spaffing out something more meaningful is probably a good idea.