Closed harveyrandall closed 1 year ago
Is it clear to you how this works? I get that error on every use of the program, but I have manually put a TV in the config.json file. Is that not enough? It looks like the program reads the file on startup. It looks similar to the example (but with correct info). Is there more that has to be prepared before the program can be used?
The command arg parsing needs some work, it started out only supporting one TV and was updated to support multiple. Happy to receive PRs
I'm looking for documentation what is expected in the config file. I am trying to use the software on a server that has 4 network interfaces, the LG TVs being on one of them. It looks like "scan" is not able to handle that, no way to specify an interface. Then, on that network I have 4 LG TVs. I have enabled network control on one of them, and noted down the generated key (displayed by the TV), and put IP, client-key (that value) and its mac-address in a config.json file similar to the example. I verified using strace that it indeed opens that file. But still it doesn't work. So I need to know if this way is going to lead to success or if I completely misunderstand things.
I think this ticket probably has been fixed already, via the better argument parsing in https://github.com/klattimer/LGWebOSRemote/pull/128 and allowing a default TV to be specified via https://github.com/klattimer/LGWebOSRemote/pull/137.
Given the way the options parsing is structured currently the name of the TV to connect to isn't defined when it attempts to open it. A temporary fix may be to default to the first TV defined in
config.json
.A more robust solution would then be to have a general config file (
.json
or.ini
) with defaults, first TV you auth with becomes the defaultname
which the user can change with a separate CLI optionconfig
to allow users to get and set their preferences.[Out of scope: Refactoring
__init__.py
to useargparser
rather thansys.argv
& useconfigparser
for user preferences in a.json
or.ini
file. Happy to do this myself and submit separate PRs for each.]