cmer / lg-tv-control-macos

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

Still not working after latest fix #35

Closed leoleung25 closed 6 months ago

leoleung25 commented 7 months ago

Hello,

Thank you for the fix however it still doesn't work for me, below is the log

2023-12-14 15:23:22: Welcome to the Hammerspoon Console!
You can run any Lua code in here.

2023-12-14 15:23:22: -- Lazy extension loading enabled
2023-12-14 15:23:22: -- Loading ~/.hammerspoon/init.lua
2023-12-14 15:23:22: *** ERROR: /Users/leoleung/.hammerspoon/lgtv_init.lua:68: attempt to call a nil value (global 'file_exists')
stack traceback:
    /Users/leoleung/.hammerspoon/lgtv_init.lua:68: in function 'lgtv_disabled'
    /Users/leoleung/.hammerspoon/lgtv_init.lua:91: in function 'lgtv_log_init'
    /Users/leoleung/.hammerspoon/lgtv_init.lua:100: in main chunk
    [C]: in function 'rawrequire'
    ...poon.app/Contents/Resources/extensions/hs/_coresetup.lua:662: in function 'require'
    /Users/leoleung/.hammerspoon/init.lua:1: in main chunk
    [C]: in function 'xpcall'
    ...poon.app/Contents/Resources/extensions/hs/_coresetup.lua:723: in function 'hs._coresetup.setup'
    (...tail calls...)
Krizid commented 7 months ago

same issue

Krizid commented 7 months ago

I don't know if this will help anyone else but it worked for me.

i commented with -- infront of the script eg. line68 looks likes this return file_exists("./disable_lgtv") or file_exists(os.getenv('HOME') .. "/.disable_lgtv")

what i did -- return file_exists("./disable_lgtv") or file_exists(os.getenv('HOME') .. "/.disable_lgtv")

line91 same thing I added --

at the top where the configuration is look for local lgtv_path = "~/.local/bin/lgtv" -- Full path to lgtv executable

my path was different so i changed it to. local lgtv_path = "/opt/lgtv-venv/bin/lgtv" -- Full path to lgtv executable

after doing that it worked for me and stopped throwing up any errors.

hope it will help someone until an update.

leoleung25 commented 7 months ago

Works like a charm! Thank you!!

cmer commented 6 months ago

at the top where the configuration is look for local lgtv_path = "~/.local/bin/lgtv" -- Full path to lgtv executable

If you install the library with pipx like in the instructions, the executable will be in ~/.local/bin.

cmer commented 6 months ago

Fixed.

Krizid commented 6 months ago

i have tried installing with the pipx. that gives me the previous error with wrap socket