aiowebostv
Python library to control LG webOS based TV devices.
Based on:
aiopylgtvlibrary at https://github.com/bendavid/aiopylgtvbscpylgtvlibrary at https://github.com/chros73/bscpylgtv
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aiowebostv-0.9.2.tar.gz.
File metadata
- Download URL: aiowebostv-0.9.2.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
940b9544cfa47c76891324ffda67251f4945090ddfe1528c4984caf011f9c3ca
|
|
| MD5 |
9f389446fb0d87c5b76b4a63caad4b03
|
|
| BLAKE2b-256 |
5d5a492f69258ce5e2cfc081cf9ec8c49410c12e3937c792ca439cf1e3387f50
|
Provenance
The following attestation bundles were made for aiowebostv-0.9.2.tar.gz:
Publisher:
publish-to-pypi.yml on home-assistant-libs/aiowebostv
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aiowebostv-0.9.2.tar.gz -
Subject digest:
940b9544cfa47c76891324ffda67251f4945090ddfe1528c4984caf011f9c3ca - Sigstore transparency entry: 2552946183
- Sigstore integration time:
-
Permalink:
home-assistant-libs/aiowebostv@2eff73981b12b22e147ae224b34172a9eb05312c -
Branch / Tag:
refs/tags/v0.9.2 - Owner: https://github.com/home-assistant-libs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@2eff73981b12b22e147ae224b34172a9eb05312c -
Trigger Event:
release
-
Statement type:
File details
Details for the file aiowebostv-0.9.2-py3-none-any.whl.
File metadata
- Download URL: aiowebostv-0.9.2-py3-none-any.whl
- Upload date:
- Size: 19.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41cc6bfd662439146654ac2ef207457ffca3567a76cddf5b36e192a4c63b11b8
|
|
| MD5 |
5f3fb671efa1f7049053635ba8364b2f
|
|
| BLAKE2b-256 |
6a075bc291f9960e4e2b2b3390d6dc285889185f96c305089faac975b577d335
|
Provenance
The following attestation bundles were made for aiowebostv-0.9.2-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on home-assistant-libs/aiowebostv
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aiowebostv-0.9.2-py3-none-any.whl -
Subject digest:
41cc6bfd662439146654ac2ef207457ffca3567a76cddf5b36e192a4c63b11b8 - Sigstore transparency entry: 2552946221
- Sigstore integration time:
-
Permalink:
home-assistant-libs/aiowebostv@2eff73981b12b22e147ae224b34172a9eb05312c -
Branch / Tag:
refs/tags/v0.9.2 - Owner: https://github.com/home-assistant-libs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@2eff73981b12b22e147ae224b34172a9eb05312c -
Trigger Event:
release
-
Statement type: