cmer / lg-tv-control-macos

Automatically wake/sleep and change the input of your LG TV when used as a monitor on macOS
129 stars 13 forks source link

Modified exec_command to understand multi option command put "ssl" next last command. #8

Closed fakeskimo closed 1 year ago

fakeskimo commented 1 year ago

"ssl" is need to put just next of second command part when using current version lgtv commit link

Example: lgtv MyTV startApp com.webos.app.hdmi1 ssl --> fails lgtv MyTV startApp ssl com.webos.app.hdmi1 --> success

Therefore I added step to put "ssl" next of second command part in exec_command.

fakeskimo commented 1 year ago

I put back original "lgtv_disabled" function to resolve the conflict. LMK if there is any further issue. Thanks!

zakkhoyt commented 1 year ago

@fakeskimo YES! Great catch. I have been trying to diagnose this problem today. It hadn't occurred that the args were out of order. I just tried this out with manual commands and it works as expected.


Edit: I was looking at the lgtv repo and they state that the ssl param should go at the end,. I guess this is correct for some commands and not others (like lgtv auth <ip_address_here> MyTV ssl.

The changes in this PR will work for the startApp command, but if this script ends up supporting more commands this may cause some confusion.