Fork of androidtv (python-androidtv) that uses adb-shell-wifi to add modern ADB Wi-Fi (TLS) pairing support.
Project description
This package is a fork of python-androidtv that adds support for modern ADB Wi-Fi pairing — the 6-digit-code TLS pairing flow introduced in Android 11’s “Wireless debugging” feature, plus the post-pairing TLS data channel and mDNS-based service discovery.
It exists primarily as a testbed for verifying that Wi-Fi pairing support can be added to Home Assistant’s Android TV integration. If you do not need Wi-Fi pairing, install upstream androidtv instead — the upstream package is the canonical home of all non-Wi-Fi functionality.
Original androidtv documentation: https://androidtv.readthedocs.io
About
androidtv_wifi is a Python package that provides state information and control of Android TV and Fire TV devices via ADB, including modern ADB Wi-Fi pairing. It depends on adb-shell-wifi (a corresponding fork of adb-shell).
Installation
pip install androidtv-wifi
To utilize the async version of this code, you must install into a Python 3.7+ environment via:
pip install androidtv-wifi[async]
ADB Wi-Fi (TLS) support
Modern Android (11+) deprecates the legacy adb tcpip flow in favor of ADB Wi-Fi, which uses a one-shot pairing handshake plus a TLS 1.3 data channel on a randomized port advertised over mDNS.
Install with the wifi extra:
pip install androidtv-wifi[wifi]
Then either pass connection_type="tls" to setup() / BaseTVAsync / etc., or construct the device classes directly:
from androidtv_wifi import setup
from androidtv_wifi.wifi import pair, discover_connect_services
# One-time pairing — user opens "Pair device with pairing code"
# in Wireless debugging settings on the TV and reads off the code.
pair(host=PAIR_IP, port=PAIR_PORT, pairing_code="123456",
adbkey="/path/to/adbkey")
# Subsequent connects. Discover the (random) TLS port via mDNS.
services = discover_connect_services(timeout_s=4.0)
tv = setup(host=services[0].host, port=services[0].port,
adbkey="/path/to/adbkey", connection_type="tls")
The legacy connection_type="tcp" path (default) is unchanged — existing users on older Android versions or pre-paired devices using adb tcpip need to do nothing.
ADB Intents and Commands
A collection of useful intents and commands can be found here (credit: mcfrojd).
Acknowledgments
This fork is based on python-androidtv by Jeff Irion, which itself is based on python-firetv by happyleavesaoc and the androidtv component for Home Assistant by a1ex4. This fork depends on adb-shell-wifi (a fork of adb-shell, which is based on python-adb) and pure-python-adb.
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 androidtv_wifi-0.1.1.tar.gz.
File metadata
- Download URL: androidtv_wifi-0.1.1.tar.gz
- Upload date:
- Size: 69.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03e0f52e5e76910450b3337cf37830fea092b23d3f52c23b4086fc80e144c866
|
|
| MD5 |
893c7841bd2e6e880202ef934c59ab43
|
|
| BLAKE2b-256 |
adc72b08a6cb3e16a733dc930e2ddec0c7126a610479f8ca1dc0c3911d577e4f
|
File details
Details for the file androidtv_wifi-0.1.1-py3-none-any.whl.
File metadata
- Download URL: androidtv_wifi-0.1.1-py3-none-any.whl
- Upload date:
- Size: 55.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4051dedaddbf7c1d66d469cfbca01722e6e6a209ad46d4fedde8680918884ce2
|
|
| MD5 |
b9226da93c67d1693c72d96e8e8f3436
|
|
| BLAKE2b-256 |
48886fe22e344155c1ca461c8a76e7368f126f2330af9e164526c14d7418a868
|