Skip to content

Debloat any Android or Google TV over Wi-Fi and get an Apple TV-style home.

Merge PR #1028: Screenshots required for add-ons and switches, as for themes

Gathin2301e7cecb0a04
diff --cc addons/README.md
index 51f1ff1ca,27f229538..79a9fe33c
--- a/addons/README.md
+++ b/addons/README.md
@@@ -7,19 -7,14 +7,19 @@@ the core bigger or change how it behave
## Add-ons
- | Add-on | What it does | Author | Tested on | Permissions |
- |---|---|---|---|---|
- | [Frigate Glance](frigate-glance/) | Frigate camera pop-ups over whatever is playing | [NickLD](https://github.com/NickLD) | TCL 65Q650G | overlay, accessibility (card keys), network, foreground service |
- | [Capacity Stats](capacity-stats/) | Available/total and used/total RAM; available/total storage | [lionlev21](https://github.com/lionlev21) | Android TV 12 (model private) | None |
- | [Weather](weather/) | The weather for one city: now, US air quality and the next three days, from Open-Meteo (no key) | [@Sumyabazar1](https://github.com/Sumyabazar1) | Hisense SmartTV 4K FFM (lushan), Google TV 12 | `INTERNET` |
- | [Photo Prints](photo-prints/) | Your own photos as a screensaver: dated prints dealt in on a time-of-day sky, and a card that starts the slideshow | [@shivamsingh262](https://github.com/shivamsingh262) | Sony BRAVIA KD-65X82L (Google TV 12) | None |
- | [Photo screensaver](photo-screensaver/) | Your own pictures and MP4 clips as the TV's screensaver and as a card, slowly zooming and crossfading (20 s each by default); optional time, photo dates, prints on a sky and weather | [JorickGU](https://github.com/JorickGU) | TCL 43P69K (Google TV 12) | `INTERNET` and coarse location, only with the weather option on |
- | [Prayer Times](prayer-times/) | Today's prayer times for one city from Aladhan (no key), the next prayer with a countdown, Gregorian and Hijri dates | [@majnioui](https://github.com/majnioui) | Xiaomi TV (MiTV-MOOR2), Google TV 11 | `INTERNET` |
- | [TV Hub](tv-hub/) | One live-TV guide for M3U/XMLTV playlists, Dispatcharr and HDHomeRun tuners, with a Media3 player and shortcuts to installed live-TV apps | [@maxhayim](https://github.com/maxhayim) | MOKA R8G (Android TV 14) | `INTERNET` |
- | [Headphones](headphones/) | Bluetooth headphones made easy: where the sound goes, paired pairs with battery, a pairing shortcut, and a quiet guard that pauses and mutes the speakers when headphones drop | [@maxhayim](https://github.com/maxhayim) | MOKA R8G (Android 14) | Bluetooth (paired devices only) |
- | [TV Static](tv-static/) | An off-the-air moment each time the screen turns on: the picture opens from a bright line, snow and hiss, colour bars or an old "no signal" screen for 3 to 10 s, then fades into what was on screen; the card sets style, sound and length | [@luyzfernando08](https://github.com/luyzfernando08) | Xiaomi Mi Box S (Android TV 9), Philco by Skyworth (Android TV 14) | foreground service (screen-on watcher), start at boot, display over other apps |
- | [Brightness](brightness/) | Dims the picture below the TV's own minimum over every app (and the picture settings on Realtek TVs), with a warm night mode on a schedule and a one-press normal screen | [@maxhayim](https://github.com/maxhayim) | MOKA R8G (Android 14) | overlay, foreground service, start at boot |
- | [Sleep Timer](sleep-timer/) | A sleep timer: 15 to 120 minutes, a one-minute countdown over what is playing with "15 more minutes", then standby; over HDMI-CEC the TV turns off with the box | [@luyzfernando08](https://github.com/luyzfernando08) | Xiaomi Mi Box S (Android TV 9) | accessibility (lock-screen action only), display over other apps, exact alarms |
+ | Add-on | What it does | Author | Tested on | Permissions | Screenshot |
+ |---|---|---|---|---|---|
-| [Frigate Glance](frigate-glance/) | Frigate camera pop-ups over whatever is playing | NickLD | TCL 65Q650G | overlay, accessibility (card keys), network, foreground service | wanted |
++| [Frigate Glance](frigate-glance/) | Frigate camera pop-ups over whatever is playing | [NickLD](https://github.com/NickLD) | TCL 65Q650G | overlay, accessibility (card keys), network, foreground service | wanted |
+ | [Capacity Stats](capacity-stats/) | Available/total and used/total RAM; available/total storage | [lionlev21](https://github.com/lionlev21) | Android TV 12 (model private) | None | wanted |
+ | [Weather](weather/) | The weather for one city: now, US air quality and the next three days, from Open-Meteo (no key) | [@Sumyabazar1](https://github.com/Sumyabazar1) | Hisense SmartTV 4K FFM (lushan), Google TV 12 | `INTERNET` | <img src="weather/screenshot.jpg" width="240" alt="Weather on a TV"> |
+ | [Photo Prints](photo-prints/) | Your own photos as a screensaver: dated prints dealt in on a time-of-day sky, and a card that starts the slideshow | [@shivamsingh262](https://github.com/shivamsingh262) | Sony BRAVIA KD-65X82L (Google TV 12) | None | wanted |
+ | [Photo screensaver](photo-screensaver/) | Your own pictures and MP4 clips as the TV's screensaver and as a card, slowly zooming and crossfading (20 s each by default); optional time, photo dates, prints on a sky and weather | [JorickGU](https://github.com/JorickGU) | TCL 43P69K (Google TV 12) | `INTERNET` and coarse location, only with the weather option on | wanted |
+ | [Prayer Times](prayer-times/) | Today's prayer times for one city from Aladhan (no key), the next prayer with a countdown, Gregorian and Hijri dates | [@majnioui](https://github.com/majnioui) | Xiaomi TV (MiTV-MOOR2), Google TV 11 | `INTERNET` | <img src="prayer-times/screenshot.jpg" width="240" alt="Prayer Times on a TV"> |
++| [TV Hub](tv-hub/) | One live-TV guide for M3U/XMLTV playlists, Dispatcharr and HDHomeRun tuners, with a Media3 player and shortcuts to installed live-TV apps | [@maxhayim](https://github.com/maxhayim) | MOKA R8G (Android TV 14) | `INTERNET` | <img src="tv-hub/screenshot.jpg" width="240" alt="TV Hub on a TV"> |
++| [Headphones](headphones/) | Bluetooth headphones made easy: where the sound goes, paired pairs with battery, a pairing shortcut, and a quiet guard that pauses and mutes the speakers when headphones drop | [@maxhayim](https://github.com/maxhayim) | MOKA R8G (Android 14) | Bluetooth (paired devices only) | <img src="headphones/screenshot.jpg" width="240" alt="Headphones on a TV"> |
++| [TV Static](tv-static/) | An off-the-air moment each time the screen turns on: the picture opens from a bright line, snow and hiss, colour bars or an old "no signal" screen for 3 to 10 s, then fades into what was on screen; the card sets style, sound and length | [@luyzfernando08](https://github.com/luyzfernando08) | Xiaomi Mi Box S (Android TV 9), Philco by Skyworth (Android TV 14) | foreground service (screen-on watcher), start at boot, display over other apps | <img src="tv-static/screenshot.jpg" width="240" alt="TV Static on a TV"> |
++| [Brightness](brightness/) | Dims the picture below the TV's own minimum over every app (and the picture settings on Realtek TVs), with a warm night mode on a schedule and a one-press normal screen | [@maxhayim](https://github.com/maxhayim) | MOKA R8G (Android 14) | overlay, foreground service, start at boot | <img src="brightness/screenshot.jpg" width="240" alt="Brightness on a TV"> |
++| [Sleep Timer](sleep-timer/) | A sleep timer: 15 to 120 minutes, a one-minute countdown over what is playing with "15 more minutes", then standby; over HDMI-CEC the TV turns off with the box | [@luyzfernando08](https://github.com/luyzfernando08) | Xiaomi Mi Box S (Android TV 9) | accessibility (lock-screen action only), display over other apps, exact alarms | <img src="sleep-timer/screenshot.jpg" width="240" alt="Sleep Timer on a TV"> |
A widget, an info tile, a storage or smart-home card: if it can live as its own small app, it can live
here. See the rules below.
diff --cc addons/sleep-timer/screenshot.jpg
index 000000000,000000000..392cb6f88
new file mode 100644
Binary files differ
diff --cc addons/tv-static/screenshot.jpg
index 000000000,000000000..fa102d681
new file mode 100644
Binary files differ
diff --cc tests/test_switches.py
index 000000000,9cc664412..57e1a43cd
mode 000000,100644..100644
--- a/tests/test_switches.py
+++ b/tests/test_switches.py
@@@ -1,0 -1,100 +1,102 @@@
+ """Every theme key (a switch) has a screenshot of it on a real TV, listed in docs/switches.md.
+
+ The site's Switches tab reads the same table, so a key added with its screenshot shows up there too.
+ Run from the repository root: python3 -m unittest discover -s tests -v
+ """
+ import re
+ import struct
+ import sys
+ import unittest
+ from pathlib import Path
+
+ sys.path.insert(0, str(Path(__file__).resolve().parent))
+ from test_themes import MAX_SCREENSHOT, jpeg_size # noqa: E402
+
+ ROOT = Path(__file__).resolve().parents[1]
+ DOCS = ROOT / "docs"
+ THEMES_README = ROOT / "themes" / "README.md"
+ SWITCHES = DOCS / "switches.md"
+
+ # Keys from before screenshots were required. This list only shrinks: once a key has a row in
+ # docs/switches.md, take it off here.
+ SCREENSHOT_WANTED = {
+ "accent_color", "advanced_effects", "always_show_names", "ambient_glow", "animations",
- "app_banners", "app_glow", "app_keys", "app_labels", "app_library", "background_color",
- "boot_to_live_tv", "cinematic_home", "coocaa_sources", "dock_apps", "dock_even_padding",
- "dock_glass", "dock_opacity", "dock_row", "dock_title", "festival_until", "fill_dock",
++ "app_banners", "app_glow", "app_keys", "app_labels", "app_library", "app_library_selection",
++ "background_color", "boot_to_live_tv", "cinematic_art", "cinematic_dots", "cinematic_home",
++ "cinematic_scrim", "cinematic_white_focus", "coocaa_sources", "dock_apps", "dock_even_padding",
++ "dock_glass", "dock_opacity", "dock_row", "dock_title", "fade_rows", "festival_until", "fill_dock",
+ "focus_overshoot", "glow_style", "greeting", "greeting_name", "handle_view_inputs", "hidden_apps",
+ "icon_only_buttons", "icon_only_inputs", "input_action", "input_key_keycodes", "input_sources",
+ "input_uri_scheme", "key_filter", "launch_actions", "launcher_settings_button", "library_apps",
+ "library_button", "live_tv_action", "live_tv_input_id", "live_tv_package", "module_cards",
+ "race_calendar", "reduced_motion", "reorder_button", "restore_key_services", "rows_below_dock",
- "settings_key_keycodes", "shamsi_date", "show_home_settings_shortcut", "show_inputs_pill",
- "show_network_pill", "show_stats", "source_panel_action", "source_panel_extra",
- "source_panel_service", "stock_home_redirect", "tile_menu", "top_menu", "vpn_app", "wallpaper",
- "wallpaper_captions", "wallpaper_dim", "wallpaper_order", "wallpaper_true_color",
- "wifi_label_width",
++ "settings_fallback_components", "settings_key_keycodes", "shamsi_date",
++ "show_home_settings_shortcut", "show_inputs_pill", "show_network_pill", "show_stats",
++ "source_panel_action", "source_panel_extra", "source_panel_service", "stock_home_redirect",
++ "tile_menu", "top_menu", "vpn_app", "wallpaper", "wallpaper_captions", "wallpaper_dim",
++ "wallpaper_moods", "wallpaper_order", "wallpaper_true_color", "wifi_label_width",
++ "wifi_status_color",
+ }
+
+
+ def theme_keys():
+ """Every key in the Keys table of themes/README.md, as the site reads it."""
+ keys, on = [], False
+ for line in THEMES_README.read_text(encoding="utf-8").split("\n"):
+ if re.match(r"^##\s", line):
+ on = bool(re.match(r"^##\s+Keys\s*$", line))
+ if not on or not re.match(r"^\|\s*`[a-z_]+`", line):
+ continue
+ for key in re.findall(r"`([a-z_]+)`", line.split("|")[1]):
+ if key not in keys:
+ keys.append(key)
+ return keys
+
+
+ def screenshot_rows():
+ """key -> image path relative to docs/, from the Screenshots table of docs/switches.md."""
+ rows = {}
+ for line in SWITCHES.read_text(encoding="utf-8").split("\n"):
+ m = re.match(r'^\|\s*`([a-z_]+)`\s*\|.*<img[^>]*\bsrc="([^"]+)"', line)
+ if m:
+ rows[m.group(1)] = m.group(2)
+ return rows
+
+
+ def png_size(data):
+ if data[:8] != b"\x89PNG\r\n\x1a\n" or data[12:16] != b"IHDR":
+ return None
+ return struct.unpack(">II", data[16:24])
+
+
+ class SwitchScreenshotTest(unittest.TestCase):
+ def test_every_key_has_a_screenshot(self):
+ rows = screenshot_rows()
+ for key in theme_keys():
+ with self.subTest(key=key):
+ if key in SCREENSHOT_WANTED:
+ self.assertNotIn(key, rows, "it has a screenshot now: take it off SCREENSHOT_WANTED")
+ continue
+ self.assertIn(key, rows, "no screenshot: add one to docs/switches.md (see its Adding a key section)")
+
+ def test_screenshots_exist_and_fit_the_rules(self):
+ for key, src in screenshot_rows().items():
+ with self.subTest(key=key):
+ path = (DOCS / src).resolve()
+ self.assertTrue(path.is_file(), f"{src} does not exist")
+ data = path.read_bytes()
+ self.assertLessEqual(len(data), MAX_SCREENSHOT, f"{src} is over 300 KB")
+ size = jpeg_size(data) or png_size(data)
+ self.assertIsNotNone(size, f"{src} is not a JPEG or PNG")
+ width, height = size
+ self.assertEqual(width * 9, height * 16, f"{src} is {width}x{height}, not 16:9")
+ self.assertLessEqual(width, 1920, f"{src} is wider than 1920; 1280x720 is enough")
+
+ def test_rows_and_wanted_list_name_real_keys(self):
+ keys = set(theme_keys())
+ self.assertEqual(set(screenshot_rows()) - keys, set(), "docs/switches.md lists a key themes/README.md does not")
+ self.assertEqual(SCREENSHOT_WANTED - keys, set(), "SCREENSHOT_WANTED names a key themes/README.md does not")
+
+
+ if __name__ == "__main__":
+ unittest.main()