Add volume management to AVR
Deploy HEOS panel / deploy (push) Successful in 26s

This commit is contained in:
franzz committed 2026-09-20 18:18:28 +02:00
1 parent db00e57ef7
commit 9a3d0b8a72
6 files changed
+42 -19

No files matched your search

+2 -7
View File
@@ -151,7 +151,7 @@ els('.card[data-room]').forEach((node) => {
const direction = Number(button.dataset.delta);
holdable(button, () => nudge(key, direction));
});
if (room.meter) draggable(room);
draggable(room);
seekable(room);
// A cover that will not load (gone, or plain http on an https page) is
@@ -165,10 +165,7 @@ els('.card[data-room]').forEach((node) => {
if (room.next) room.next.addEventListener('click', () => skipTrack(key, 'next'));
});
/* The volume row, which the AVR's card has not got: its own level is not in
/api/state, so there is nothing to draw a meter from. */
function paintVolume(room) {
if (!room.meter) return;
const known = room.volume !== null && room.volume !== undefined;
room.level.textContent = known ? room.volume : '—';
// The fill and the knob riding it both size themselves off this.
@@ -191,9 +188,6 @@ function paintTransport(room) {
if (room.next) room.next.disabled = !room.available;
}
/* The Spotify buttons and the host toggle, which the AVR's card has not got:
those resume an account in a room, or join it to the AVR, and neither is
something the AVR does to itself. */
function paintSources(room) {
if (!room.sources) return;
// Grouped, the room plays whatever the AVR does, so resuming Spotify on it
@@ -787,6 +781,7 @@ function render(state) {
// play state is that device's -- HEOS has none to give for an input.
applyRoom(rooms[HOST], {
available: avr.connected !== false,
volume: avr.volume,
now_playing: avr.now_playing || null,
play_state: (avr.now_playing || {}).play_state || null,
});