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
- Official implementation of the pairing protocol in Java
- Implementation in Python but for the old v1 protocol
- Implementation in Node JS for the v2 protocol
- Description of the v2 protocol
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
Release history Release notifications | RSS feed
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65b6d3970bc2df3b5bf297b7877bb9eaab0a6d5644bec13d99f9512b64741ec9
|
|
| MD5 |
ee2f2d17b884a5af01fef1485df30ea3
|
|
| BLAKE2b-256 |
de8022f08bab95a311f03ac46139dcd99f883d8d99277d5a0c70b1fbb001bf3c
|
Provenance
The following attestation bundles were made for androidtvremote2-0.3.0.tar.gz:
Publisher:
python-publish.yml on tronikos/androidtvremote2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
androidtvremote2-0.3.0.tar.gz -
Subject digest:
65b6d3970bc2df3b5bf297b7877bb9eaab0a6d5644bec13d99f9512b64741ec9 - Sigstore transparency entry: 660710188
- Sigstore integration time:
-
Permalink:
tronikos/androidtvremote2@5bc26fc74042ff1199d1795919975dd3c07e2b43 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/tronikos
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@5bc26fc74042ff1199d1795919975dd3c07e2b43 -
Trigger Event:
release
-
Statement type:
File details
Details for the file androidtvremote2-0.3.0-py3-none-any.whl.
File metadata
- Download URL: androidtvremote2-0.3.0-py3-none-any.whl
- Upload date:
- Size: 51.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2874b6292df75ef77a8b2a88906c6267944a05216007190b83c5a912d3fc3bc6
|
|
| MD5 |
e5561b57ea5816f0da7d909073b10fd8
|
|
| BLAKE2b-256 |
39f9fa55e7d9d5132e303f1054095fc826f4c1030ee3e3ad6239c533d6623e9e
|
Provenance
The following attestation bundles were made for androidtvremote2-0.3.0-py3-none-any.whl:
Publisher:
python-publish.yml on tronikos/androidtvremote2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
androidtvremote2-0.3.0-py3-none-any.whl -
Subject digest:
2874b6292df75ef77a8b2a88906c6267944a05216007190b83c5a912d3fc3bc6 - Sigstore transparency entry: 660710190
- Sigstore integration time:
-
Permalink:
tronikos/androidtvremote2@5bc26fc74042ff1199d1795919975dd3c07e2b43 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/tronikos
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@5bc26fc74042ff1199d1795919975dd3c07e2b43 -
Trigger Event:
release
-
Statement type: