Expand usage of websockets for parameter / BPM setting#149
Merged
sastraxi merged 30 commits intoJun 4, 2026
Conversation
- Add FakeWebSocketBridge to conftest; patch AsyncWebSocketBridge in integration stack - Add ws_bridge field to SystemFixture (6th element) - Update test_v3_toggle_plugin_bypass_direct/via_footswitch to assert WebSocket messages - Update test_set_mod_tap_tempo/none to assert transport-bpm messages instead of REST POSTs - Fix all SystemFixture unpacks across test suite (5-tuple → 6-tuple) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Positional unpacks break every time a new field is added. A dataclass allows attribute access so field additions never require mechanical fixes across test files. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Mechanical follow-up to the NamedTuple → dataclass conversion. Every unpack site across all test files now uses named attribute access, so future field additions to SystemFixture require no changes here. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
# Conflicts: # modalapi/modhandler.py
…eter-set # Conflicts: # modalapi/modhandler.py # pistomp/hardware.py # pyproject.toml # uv.lock
# Conflicts: # modalapi/modhandler.py
…eter-set # Conflicts: # tests/integration/test_tap_tempo.py # tests/v3/test_plugins.py # uv.lock
…eter-set # Conflicts: # tests/integration/conftest.py
# Conflicts: # tests/test_ws_protocol.py
# Conflicts: # tests/v3/test_plugins.py
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.
Migrates outbound parameter/bypass/tempo writes from the bespoke
pi_stomp_setREST endpoint to the existing MOD-UI WebSocket, and adds inbound handling for plugin-bypass echoes so the LCD stays in sync with MOD-UI-originated changes.This removes our need to maintain a fork that adds the
pi_stomp_setREST endpoint.Outbound messages
param_set /graph/<inst>/:bypass <v>param_set /graph/<inst>/<sym> <v>transport-bpm <bpm>Inbound messages
param_set /graph/<inst> :bypass <v>from MOD-UI is parsed into aPluginBypassMessage, updates plugin state, and redraws the LCD plugin row. Idempotent on self-echo.Changes
try/exceptswallow around bridge construction is gone. If the bridge fails to construct or start, handler init raises. Two unit tests pin this.plugin.bypassback if the POST returned non-200. Fire-and-forget is fine here because the WS connection is the source of truth: if we're connected, we're synchronized; if we're not, the bridge will reconnect and the next state change carries us forward.instance_id.Plugin.instance_idis normalized at construction (leading slash stripped). The parser produces bare instance names. Comparisons are plain==.send_parameterstill defensively strips + warns if a caller passes a slashed id (probably best to figure out a way to enforce this at the type layer later)