Skip to content

v0.5.0 — media player, and entities that admit when they don't know

Choose a tag to compare

@github-actions github-actions released this 08 Sep 01:20
· 15 commits to main since this release

Six issues closed. The headline is a media player entity, which gets you
the built-in Media Control card and voice-assistant support without a custom
frontend.

Added

A media player per window. The current view as cover art, its title, and
where it was filmed, with transport and volume. It presents the same state the
other entities do, so nothing you already built stops working.

Volume is scaled from the window's own reported range rather than treated as a
percentage — the range is per-device and never 0-100, so the ends have to land
exactly or the quietest and loudest settings become unreachable. Stepping moves
by one unit the window recognises, not a tenth of the range, because a range
can be as coarse as six values.

Play and pause are deliberately absent: the protocol has no such command, and
a card offering a button that does nothing cannot be told from a fault. Home
Assistant hides media attributes while a player is off, so the card looks
empty until the window is awake.

The live GATT table in the diagnostics download. Every service and
characteristic with its declared properties, which is the one thing about a
window that nobody without one can obtain. Properties are reported exactly as
declared, including on the two characteristics known to advertise write and
discard it — correcting them would hide the finding. Safe to attach to an
issue: identifying fields stay redacted, and a GATT table describes a model
rather than a unit.

Changed

Entities go unavailable when the Bluetooth link drops, instead of serving
the last value they were told for up to a minute. With a toggle-only display
that matters more than it sounds: an automation acting on a stale reading
inverts the command it then sends.

State is published once per poll. The client was publishing from refresh
and set_power as well as from a notification, and the coordinator publishes
what those return — so every entity was written twice per poll and the refresh
timer was being reset out of band.

set_setting re-reads before refusing. A key missing from the settings
document was treated as a key the firmware lacks, when it is equally a
notification that went astray. Only one of those is recoverable, and
re-reading tells them apart.

Not implementable, now recorded as such

View selection is closed
(#7).
No characteristic selects a view and none of the fifteen control tokens does
either; the one that looks like it should discards writes. FW and BW are
the whole navigation surface.

Testing

239 tests, up from 150. The larger part of that is not new coverage but
coverage that now runs: tools/selftest.py held 119 working assertions that
no CI job executed, leaving 1,932 lines of diagnostic tooling unverified
on every push. Those checks are now 67 pytest functions in the fast suite, and
the hand-rolled harness around them is deleted.

Every new behaviour in this release was verified by mutating the code it
targets and confirming the test fails.

Still unverified

Bluetooth is faked throughout, so timing-sensitive behaviour remains proven
against a model of the window rather than a window. Per-claim hardware
validation is
#5,
which this release makes materially easier: the GATT table it asks for now
arrives from Download diagnostics instead of a terminal.