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

Script turns on TV despite being physically disconnected from the device #37

Closed omerli closed 3 months ago

omerli commented 6 months ago

First, thanks for this project! it's very useful to me!

The issue I'm experiencing is that even if the laptop is physically disconnected from the TV, the script would still turn on the TV when the laptop is woken up.

Thanks for looking into it

slawek-wozniak commented 6 months ago

I'd love to have a fix for this, this is so inconvenient that I'm considering uninstalling all of this and just going back to pressing the on button, I already have the tv default switch to hdmi 1 when turning on, so it's not that bad at all.

Perhaps with hammerspoon it is possible to check if an external display is connected? Or if the hdmi is populated or something. Surely... and then execute all of this only if a display is connected to the device. It wouldn't have to know that the LG tv is connected to the macbook, just that a monitor is connected would be enough. Although I suppose that if the TV is off then even with hdmi plugged in, the laptop will say it has 1 screen. :(