diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 5540d57..0b135f0 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -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 diff --git a/LGTV/__init__.py b/LGTV/__init__.py index c5db6fd..f02eb14 100644 --- a/LGTV/__init__.py +++ b/LGTV/__init__.py @@ -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() diff --git a/README.md b/README.md index 489f1e2..1bb09e1 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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