feat: API-call action for buttons and sliders#8
Merged
Conversation
Adds a configurable HTTP request action in the button/slider wizard:
- Method (GET/POST/PUT/PATCH/DELETE), endpoint URL, optional JSON
payload, and optional bearer token.
- Slider actions substitute the {value} placeholder in URL and payload
with the live slider percent (0-100).
- Per-action update interval (50-1000 ms, default 500) throttles
slider-driven requests and always flushes the final value; validated
in the wizard. Buttons fire once per press.
Requests run on a detached thread in the actuator so a slow endpoint
never stalls audio. Uses ureq (blocking, rustls TLS). Existing presets
stay compatible via serde defaults.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Adds a configurable API call action to the button/slider wizard, so a button press or slider movement can fire an HTTP request.
{value}placeholder in the URL and payload is replaced with the live slider percent (0–100).Implementation
ApiCallmodel (method,url,payload,bearer,throttle_ms) onButtonActionandAudioStream;ActionKind::ApiCall.Cmd::ApiCallexecuted on a detached thread in the actuator so a slow endpoint never stalls audio. Uses ureq (blocking, rustls TLS).Compatibility
Existing presets load unchanged — new fields use serde defaults.
Tests
cargo test— 14 passed (4 new:{value}substitution for sliders vs. buttons,HttpMethodindex round-trip,ApiCalllabel/stream).🤖 Generated with Claude Code