Show the album cover on a media tile, in the same strip as the live camera pictures (0.2.92)

A single or double-width media player tile takes Display -> Album cover
on a Guition: the cover of what plays in the icon's place, like Home
Assistant's own tile. It rides in the page's strip of 0.2.91: the request
and the answer are the same, a media player is simply among the tiles.
The app fetches a player's picture only when its address changes; a page
with a camera loads at the camera's pace with the cover reused, a page of
media tiles alone loads once, and a new track (the picture's mark in the
state, part of the page's wish) asks again at once. A player without a
picture keeps its icon and is not asked for; the double-width tile keeps
its controls; the tile over the whole page keeps the card's big cover.
Firmware 0.2.78.

Host harness 31 checks (docs/TEST_RESULTS_0292.md). CYD firmware
1,633,760 B, 89.0 %.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Max Gramser
2026-09-20 13:41:21 +02:00
parent 306636434b
commit efbab04b39
45 changed files with 352 additions and 85 deletions
+5
View File
@@ -217,6 +217,11 @@ struct Tile {
// icon's place, loaded again every `refresh` seconds.
uint16_t refresh = 15;
bool live() const { const auto d = domain(); return display == "live" && (d == "camera" || d == "image"); }
// A media player's album cover in the icon's place (firmware 0.2.78+): "display": "cover" on a single or double-width
// tile, while the player has a picture; the tile over the whole page keeps the card's big cover.
bool cover_tile() const { return display == "cover" && domain() == "media_player" && !full && !extra().media_picture.empty(); }
// A tile that draws its picture out of the page's strip (runtime_tiles.h, live_*).
bool pictured() const { return live() || cover_tile(); }
// Double width takes a row; full (firmware 0.2.62+) takes the whole page, all six slots, and is also wide.
bool wide = false, full = false;
// Direct control set on a wide card (firmware 0.2.19+); empty keeps the plain card.