Skip to main content

aiowebostv

Python library to control LG webOS based TV devices.

Based on:

Requirements

  • Python >= 3.11

Install

pip install aiowebostv

Install from Source

Run the following command inside this folder

pip install --upgrade .

Examples

Basic Example:

import asyncio
from pprint import pprint

from aiowebostv import WebOsClient

HOST = "192.168.1.39"
# For first time pairing set key to None
CLIENT_KEY = "140cce792ae045920e14da4daa414582"


async def main():
    """Basic webOS client example."""

    client = WebOsClient(HOST, CLIENT_KEY)
    await client.connect()

    # Store this key for future use
    print(f"Client key: {client.client_key}")

    pprint(client.tv_info)
    pprint(client.tv_state)

    await client.disconnect()


if __name__ == "__main__":
    asyncio.run(main())

Subscribed State Updates Example:

import asyncio
import dataclasses
import signal
from datetime import UTC, datetime
from pprint import pprint

from aiowebostv import WebOsClient
from aiowebostv.models import WebOsTvState

HOST = "192.168.1.39"
# For first time pairing set key to None
CLIENT_KEY = "140cce792ae045920e14da4daa414582"


async def on_state_change(tv_state: WebOsTvState) -> None:
    """State changed callback."""
    now = datetime.now(UTC).astimezone().strftime("%H:%M:%S.%f")[:-3]
    print(f"[{now}] State change:")
    # for the example, remove apps and inputs to make the output more readable
    state = dataclasses.replace(tv_state, apps={}, inputs={})
    pprint(state)


async def main():
    """Subscribed State Updates Example."""
    client = WebOsClient(HOST, CLIENT_KEY)
    await client.register_state_update_callback(on_state_change)
    await client.connect()

    # Store this key for future use
    print(f"Client key: {client.client_key}")

    # Change something using the remote to get updates or ctrl-c to exit
    sig_event = asyncio.Event()
    signal.signal(signal.SIGINT, lambda _exit_code, _frame: sig_event.set())
    await sig_event.wait()

    await client.disconnect()


if __name__ == "__main__":
    asyncio.run(main())

Examples can be found in the examples folder

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiowebostv-0.10.0.tar.gz (19.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aiowebostv-0.10.0-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file aiowebostv-0.10.0.tar.gz.

File metadata

  • Download URL: aiowebostv-0.10.0.tar.gz
  • Upload date:
  • Size: 19.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for aiowebostv-0.10.0.tar.gz
Algorithm Hash digest
SHA256 93ee7557fb49e7a59f2d4b54a1658c4edddcc8f99f9106189afae22bf3554bce
MD5 ad3f1b561ea804a62b8cf9fa688c6e4d
BLAKE2b-256 ff8e016f3d9fd6270098c200e466b146cb629d300ddc69f22c450021bf3de8be

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiowebostv-0.10.0.tar.gz:

Publisher: publish-to-pypi.yml on home-assistant-libs/aiowebostv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aiowebostv-0.10.0-py3-none-any.whl.

File metadata

  • Download URL: aiowebostv-0.10.0-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for aiowebostv-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3902e99061c83c12211a3ce9607a2a6db8455167bda863e4f50a924cae1adeaf
MD5 84a2b8da2590789a7dfaa4ec1a3db990
BLAKE2b-256 70a9f37991352dea4f48b5e06d3e6569703797fd2fc8a011ca016121a5337470

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiowebostv-0.10.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on home-assistant-libs/aiowebostv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.10.0 This release

2 files

0.9.2

2 files

0.9.1

2 files

0.9.0

2 files

0.8.0

2 files

0.7.5

2 files

0.7.4

2 files

0.7.3

2 files

0.7.2

2 files

0.7.1

2 files

0.7.0

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.0

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page