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:
@@ -213,6 +213,31 @@ describe("TileInspector: a live picture on a camera tile (app 0.2.91)", () => {
|
||||
const card = mount(TileCard, { props: { tile, slot: 0 } });
|
||||
expect(card.find(".ic").classes()).toContain("thumb");
|
||||
});
|
||||
it("offers the album cover for a media player on a Guition, not on a full-page tile, and keeps its controls", async () => {
|
||||
Object.assign(state.inventory.screens[0], { firmware: "0.2.78" });
|
||||
state.inventory.entities.push({ id: "media_player.sonos", name: "Sonos", state: "playing", area: "Hall" } as any);
|
||||
(state.inventory as any).controls.media_player = { default: "volume", choices: [{ key: "volume", label: "Volume" }, { key: "none", label: "None" }] };
|
||||
const tile: Tile = { entity: "media_player.sonos", name: "", slot: 0, options: { size: "wide" } };
|
||||
state.layout!.tiles.push(tile);
|
||||
const drawer = mount(TileInspector, { props: { tile } });
|
||||
expect(choices(drawer, "Display")).toEqual(["Name and status", "Large value", "Album cover"]);
|
||||
await row(drawer, "Display").findAll(".seg button")[2].trigger("click");
|
||||
expect(tile.options).toEqual({ size: "wide", display: "cover" });
|
||||
expect(row(drawer, "Display").find("small").text()).toMatch(/icon's place/);
|
||||
expect(row(drawer, "Refresh")).toBeUndefined();
|
||||
expect(row(drawer, "Direct control on the tile")).toBeDefined();
|
||||
const card = mount(TileCard, { props: { tile, slot: 0 } });
|
||||
expect(card.find(".ic").classes()).toContain("thumb");
|
||||
expect(card.find(".range").exists()).toBe(true);
|
||||
// A CYD gets no such choice; a tile over the whole page keeps the card's big cover.
|
||||
Object.assign(state.inventory.screens[0], { board: "cyd" });
|
||||
tile.options = { size: "single" };
|
||||
await drawer.vm.$nextTick();
|
||||
expect(choices(mount(TileInspector, { props: { tile } }), "Display")).toEqual(["Name and status", "Large value"]);
|
||||
Object.assign(state.inventory.screens[0], { board: "guition" });
|
||||
tile.options = { size: "full" };
|
||||
expect(choices(mount(TileInspector, { props: { tile } }), "Display")).toEqual(["Name and status", "Large value"]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("TileInspector: pages (app 0.2.78)", () => {
|
||||
|
||||
Reference in New Issue
Block a user