#115 Tile 5: sound-balance sparkline from dotty-behaviour#120
Merged
Conversation
Projects sound_event balance values out of the per-device recent ring (oldest-first, non-numeric balances skipped). Backs the bridge dashboard's State-tile sparkline. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replaces the empty-list stub with a live read against
/api/perception/sound-balance/{device_id}. Device picked from the
first key in the perception state snapshot (single-robot heuristic,
matches the other dashboard perception getters). Returns [] when no
device is known or the fetch fails — same circuit-breaker contract
as the other dotty-behaviour-backed getters.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tile 5 of #115 — rewire the dashboard State-tile sound-balance sparkline to read live data from dotty-behaviour.
GET /api/perception/sound-balance/{device_id}?limit=30to dotty-behaviour. Projectsdata.balanceout of the per-device recent-events ring, filtering tosound_eventonly, oldest-first to match the sparkline's left-to-right time axis. Non-numeric/missing balances skipped._dashboard_sound_balance_series()in bridge.py now returns alist[float]from the new endpoint (same signature as before, just no longer stubbed empty). Goes through the existing_dotty_behaviour_gethelper so it shares the 1.5s timeout, 2s cache, and circuit-breaker fallback._dashboard_perception_state_getter()(single-robot heuristic). Matches what the other dotty-behaviour-backed getters do; mirroring the fancier_pick_perception_device_idin dashboard.py wasn't worth the cross-module dependency for a single-robot deployment. Returns[]cleanly when no device is known.Refs #115 (Tile 6 still pending).
Test plan
cd dotty-behaviour && ../.venv/bin/python -m pytest tests/ -q→ 211 passed (was 209).venv/bin/python -m pytest tests/ -q→ 76 passed (was 73)python -c "import bridge; from bridge.dashboard import *"cleansound_eventframes.🤖 Generated with Claude Code