klattimer / LGWebOSRemote

Command line webOS remote for LGTVs
MIT License
523 stars 101 forks source link

Short circuit the "on" command #141

Closed Tenzer closed 1 year ago

Tenzer commented 1 year ago

The "on" command is special since it doesn't make use of the websocket connection. It instead sends a wake-on-lan package. This means ws.connect() isn't needed for this and actually just slows down the command because it causes ws4py to try to establish a connection to a TV that is most likely off, considering the command being executed.

I did contemplate moving the "on" command out of the LGTVRemote class, but I thought this would be a smaller change. Another alternative would be to make LGTVRemote.on into a static method so it can be called without initialising LGTVRemote, but then we loose out on the config parsing done in LGTVRemote.__init__.

Tenzer commented 1 year ago

Wow, that was quick!