Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v3
Expand Down
37 changes: 24 additions & 13 deletions LGTV/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,19 +181,30 @@ def main():
cursor.execute(args.args)
return

try:
ws = LGTVRemote(name, **config[name], ssl=args.ssl)

if args.command == "on":
# "on" is special, it doesn't use a websocket connection
ws.on()
return

ws.connect()
ws.execute(args.command, kwargs)
ws.run_forever()
except KeyboardInterrupt:
ws.close()
max_retries = 3
for attempt in range(max_retries):
try:
ws = LGTVRemote(name, **config[name], ssl=args.ssl)

if args.command == "on":
# "on" is special, it doesn't use a websocket connection
ws.on()
return

ws.connect()
ws.execute(args.command, kwargs)
ws.run_forever()
break
except ConnectionResetError:
if attempt < max_retries - 1:
wait = 5
print(f"Retrying in {wait} seconds...")
sleep(wait)
else:
print("Max retries reached. Script failed")
raise
except KeyboardInterrupt:
ws.close()

if __name__ == '__main__':
main()
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ A big thanks for the contributions over the years too, lots of people have made
* 60UJ6300-UA
* HU80KG.AEU (CineBeam 4K)
* OLED48A2
* OLED48C5PUA
* OLED55B7
* OLED55C9
* OLED55CX5LB
Expand Down Expand Up @@ -49,10 +50,12 @@ Tested with python 3.9 on Debian Unstable.
Tested with python 3.10 on Windows 10/11
Tested with 3.10 on WSL (Ubuntu 20.04)
Tested with python 3.12 on macOS
Tested with python 3.14 on Windows 11

### Likely supports

All devices with firmware major version 4, product name "webOSTV 2.0"
All devices with firmware major version 33, product name "webOSTV 25"

## Available Commands
lgtv scan
Expand Down
Loading