Skip to main content

A Python library for interacting with Android TV using the Android TV Remote protocol v2

Project description

androidtvremote2

A Python library for interacting with Android TV using the Android TV Remote protocol v2. This is the same protocol the Google TV mobile app is using. It doesn't require ADB or enabling developer tools on the Android TV device. It only requires the Android TV Remote Service that comes pre-installed on most Android TV devices.

For a list of the most common commands you can send to the Android TV see: TvKeys. For a full list see remotemessage.proto. In addition to commands you can send URLs to open apps registered to handle them. See this guide for how to find deep links for apps.

Voice commands can also be sent as PCM 16-bit mono 8 kHz audio data.

Credits

Example

See demo.py

Development environment

python3 -m venv .venv
source .venv/bin/activate
# for Windows CMD:
# .venv\Scripts\activate.bat
# for Windows PowerShell:
# .venv\Scripts\Activate.ps1

# Install dependencies
python -m pip install --upgrade pip
python -m pip install -e .

# Generate *_pb2.py from *.proto
python -m pip install grpcio-tools mypy-protobuf
python -m grpc_tools.protoc src/androidtvremote2/*.proto --python_out=src/androidtvremote2 --mypy_out=src/androidtvremote2 -Isrc/androidtvremote2

# Run pre-commit
python -m pip install pre-commit
pre-commit install
pre-commit run --all-files

# Run tests
python -m pip install -e ".[test]"
pytest

# Run demo
python -m pip install -e ".[demo]"
python src/demo.py

# Build package
python -m pip install build
python -m build

The voice demo requires the PyAudio library. Depending on the target platform, PortAudio might have to be installed manually, see PyAudio installation for more information.

Project details


Download files

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

Source Distribution

androidtvremote2-0.3.0.tar.gz (47.7 kB view details)

Uploaded Source

Built Distribution

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

androidtvremote2-0.3.0-py3-none-any.whl (51.4 kB view details)

Uploaded Python 3

File details

Details for the file androidtvremote2-0.3.0.tar.gz.

File metadata

  • Download URL: androidtvremote2-0.3.0.tar.gz
  • Upload date:
  • Size: 47.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for androidtvremote2-0.3.0.tar.gz
Algorithm Hash digest
SHA256 65b6d3970bc2df3b5bf297b7877bb9eaab0a6d5644bec13d99f9512b64741ec9
MD5 ee2f2d17b884a5af01fef1485df30ea3
BLAKE2b-256 de8022f08bab95a311f03ac46139dcd99f883d8d99277d5a0c70b1fbb001bf3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for androidtvremote2-0.3.0.tar.gz:

Publisher: python-publish.yml on tronikos/androidtvremote2

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

File details

Details for the file androidtvremote2-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for androidtvremote2-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2874b6292df75ef77a8b2a88906c6267944a05216007190b83c5a912d3fc3bc6
MD5 e5561b57ea5816f0da7d909073b10fd8
BLAKE2b-256 39f9fa55e7d9d5132e303f1054095fc826f4c1030ee3e3ad6239c533d6623e9e

See more details on using hashes here.

Provenance

The following attestation bundles were made for androidtvremote2-0.3.0-py3-none-any.whl:

Publisher: python-publish.yml on tronikos/androidtvremote2

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page