From ce82127a4037f00195b9feed7175d3ac1c6e0b88 Mon Sep 17 00:00:00 2001 From: James Mackay Date: Thu, 8 Oct 2026 07:49:07 +0100 Subject: [PATCH] ci: add lint+test workflow; schedule package constants (TiviMate/Wholphin/system media); drop the stale sibling-checkout dev dependency --- .gitea/workflows/test.yml | 28 ++++++++++++++++++++++++ custom_components/nvidia_shield/const.py | 17 +++++++++++++- pyproject.toml | 10 +++------ 3 files changed, 47 insertions(+), 8 deletions(-) create mode 100644 .gitea/workflows/test.yml diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml new file mode 100644 index 0000000..cd14e91 --- /dev/null +++ b/.gitea/workflows/test.yml @@ -0,0 +1,28 @@ +# Quality gate: lint + unit tests. +# +# The test suite is stdlib-only (parsers, intents, running-apps) and runs the +# vendored ha_adb_common helpers without installing Home Assistant — see +# tests/conftest.py. Real firmware captures live in tests/fixtures +# (how to capture more: docs/RESEARCH_SHIELD.md §8). + +name: Test + +on: + push: + branches: [master] + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install test tooling + run: python3 -m pip install --quiet pytest pytest-asyncio ruff + + - name: Lint + run: ruff check custom_components tests + + - name: Unit tests + run: python3 -m pytest tests -q diff --git a/custom_components/nvidia_shield/const.py b/custom_components/nvidia_shield/const.py index ae79490..666a01e 100644 --- a/custom_components/nvidia_shield/const.py +++ b/custom_components/nvidia_shield/const.py @@ -31,8 +31,23 @@ DEFAULT_NAME = "Nvidia Shield" # Emotiva DAG attribute we read to get available inputs ATTR_MEDIA_DAG_INPUT_MAP = "media_dag_input_map" -# Known Jellyfin app package IDs +# Known Jellyfin app package IDs (used to route Jellyfin-family clients +# — including Wholphin, a Jellyfin client — to the rich-metadata path). JELLYFIN_APP_IDS = [ "org.jellyfin.androidtv", "org.jellyfin.mobile", + "com.github.damontecres.wholphin", +] + +# Verified on-device package names (docs/RESEARCH_SHIELD.md): TiviMate does +# not publish a MediaSession on Shield Android 11 — it is the headline +# Phase-3 fallback app. +TIVIMATE_PACKAGE = "ar.tvplayer.tv" + +# Packages to ignore when parsing foreground/audio-playback identities +SYSTEM_MEDIA_PACKAGES = [ + "com.google.android.apps.mediashell", # Chromecast receiver process + "com.android.systemui", + "com.android.tv.settings", + "com.nvidia.diagtools", ] diff --git a/pyproject.toml b/pyproject.toml index eebdcc2..ea6a46a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,14 +14,10 @@ dev = [ "pytest>=8.0", "pytest-asyncio>=0.23", "ruff>=0.4", - # Shared ADB helpers. Vendored into custom_components/nvidia_shield/ha_adb_common/ - # for HACS installs; used editable from a sibling checkout for development. - # Planned migration to a proper PyPI package. - "ha-adb-common", ] - -[tool.uv.sources] -ha-adb-common = { path = "../ha-adb-common", editable = true } +# The shared ADB helpers are vendored at +# custom_components/nvidia_shield/ha_adb_common/ — the only consumed copy in +# this fork, so no extra dev dependency (and no unavailable sibling checkout). [tool.ruff] target-version = "py312"