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.1.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.1-py3-none-any.whl (51.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: androidtvremote2-0.3.1.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.1.tar.gz
Algorithm Hash digest
SHA256 11f8e33d76d8c539d26fd3002c423d21ca9264a8281bf895c0f169dab513fca1
MD5 9f78d0251ce027c01e626d35dac2b84a
BLAKE2b-256 d888600c4d06f756d7e1e0782e812fb58cd1e6bb8be371ab80dfc26fddb87bc0

See more details on using hashes here.

Provenance

The following attestation bundles were made for androidtvremote2-0.3.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for androidtvremote2-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 645bb36f8b1b5997a36a89f033ebd91c7a8bb61fbca54fda3247abbb7aebd17e
MD5 2d1bcc32b151b74fddf8790e1c36fbd8
BLAKE2b-256 70437b0fabee435bf1cbb37c04ee644f142af8056313a6babfbf2a82c3030323

See more details on using hashes here.

Provenance

The following attestation bundles were made for androidtvremote2-0.3.1-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