unfoldedcircle / integration-androidtv

Android TV integration for Remote Two
https://www.unfoldedcircle.com/
Mozilla Public License 2.0
1 stars 5 forks source link
home-automation python3

Android TV integration for Remote Two

Using androidtvremote2 and uc-integration-api.

The integration currently supports almost all features that the androidtvremote2 library provides. Button control and ON/OFF states are supported. Unfortunately media image and playing information are not retrievable. Source list is limited to a predefined list as retrieving a list of installed apps is not possible.

This integration is included in the Remote Two firmware and no external service must be run to connect with Android TV devices. A standalone service can be used for development or connecting multiple devices.

Standalone Usage

Setup

For running a separate integration driver on your network for Remote Two, the configuration in file driver.json needs to be changed:

Run

UC_CONFIG_HOME=./config python3 intg-androidtv/driver.py

Build self-contained binary

After some tests, turns out python stuff on embedded is a nightmare. So we're better off creating a single binary file that has everything in it.

To do that, we need to compile it on the target architecture as pyinstaller does not support cross compilation.

x86-64 Linux

On x86-64 Linux we need Qemu to emulate the aarch64 target platform:

sudo apt install qemu binfmt-support qemu-user-static
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes

Run pyinstaller:

docker run --rm --name builder \
    --platform=aarch64 \
    --user=$(id -u):$(id -g) \
    -v "$PWD":/workspace \
    docker.io/unfoldedcircle/r2-pyinstaller:3.11.6  \
    bash -c \
      "python -m pip install -r requirements.txt && \
      pyinstaller --clean --onefile --name intg-androidtv intg-androidtv/driver.py"

aarch64 Linux / Mac

On an aarch64 host platform, the build image can be run directly (and much faster):

docker run --rm --name builder \
    --user=$(id -u):$(id -g) \
    -v "$PWD":/workspace \
    docker.io/unfoldedcircle/r2-pyinstaller:3.11.6  \
    bash -c \
      "python -m pip install -r requirements.txt && \
      pyinstaller --clean --onefile --name intg-androidtv intg-androidtv/driver.py"

Versioning

We use SemVer for versioning. For the versions available, see the tags and releases in this repository.

Changelog

The major changes found in each new release are listed in the changelog and under the GitHub releases.

Contributions

Please read our contribution guidelines before opening a pull request.

License

This project is licensed under the Mozilla Public License 2.0. See the LICENSE file for details.