feat(metaballs): Make speed and radius configurable in metaballs mode - #788
feat(metaballs): Make speed and radius configurable in metaballs mode#788Solmath wants to merge 11 commits into
Conversation
…radius - Introduced methods to set and retrieve speed and radius factors from non-volatile storage. - Updated the `configure`, `setSpeed`, `setRadius`, and `transmit` methods to handle new parameters. - Adjusted calculations for speed and radius based on user-defined factors.
|
Important Approval pendingCodeRabbit has no unresolved comments, but it skipped the latest review. Use the checkbox below to review the latest commit. CodeRabbit will approve the changes if it finds no blocking issues.
Summary by CodeRabbit
WalkthroughMetaballs now supports configurable speed and radius settings. Firmware persists and publishes these values, while the web application provides controls and applies incoming updates. ChangesMetaballs configuration
Sequence Diagram(s)sequenceDiagram
participant Sidebar
participant WebSocket
participant MetaballsMode
participant NVS
Sidebar->>WebSocket: send speed or radius setting
WebSocket->>MetaballsMode: onReceive(payload)
MetaballsMode->>NVS: persist validated setting
MetaballsMode->>WebSocket: publish active configuration
WebSocket->>Sidebar: apply received speed and radius
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: b91b150c-61ad-4f13-9fe6-06673e492c68
📒 Files selected for processing (4)
firmware/include/modes/MetaballsMode.hfirmware/src/modes/MetaballsMode.cppwebapp/src/modes/Metaballs.tsxwebapp/src/services/Modes.tsx
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.
📜 Review details
⏰ Context from checks skipped due to timeout. (84)
- GitHub Check: Tidy (IKEA_OBEGRANSAD, esp32-c6-devkitm-1)
- GitHub Check: Tidy (IKEA_FREKVENS, esp32dev)
- GitHub Check: Tidy (IKEA_OBEGRANSAD, esp32-c5-devkitc-1)
- GitHub Check: Tidy (IKEA_FREKVENS, esp32-c3-devkitm-1)
- GitHub Check: Tidy (IKEA_FREKVENS, esp32-c6-devkitm-1)
- GitHub Check: Tidy (IKEA_OBEGRANSAD, esp32-c3-devkitm-1)
- GitHub Check: Tidy (IKEA_OBEGRANSAD, esp32-s3-devkitc-1)
- GitHub Check: Tidy (IKEA_FREKVENS, esp32-c5-devkitc-1)
- GitHub Check: Tidy (IKEA_FREKVENS, esp32-s3-devkitc-1)
- GitHub Check: Tidy (IKEA_OBEGRANSAD, esp32dev)
- GitHub Check: Default (seeed_xiao_esp32s3)
- GitHub Check: Minimal (seeed_xiao_esp32c6)
- GitHub Check: Minimal (seeed_xiao_esp32s3)
- GitHub Check: Minimal (lolin_d32)
- GitHub Check: Default (lolin_d32)
- GitHub Check: Minimal (esp32-c6-devkitm-1)
- GitHub Check: Minimal (lolin_s3_mini)
- GitHub Check: Minimal (wemos_d1_mini32)
- GitHub Check: Minimal (esp32-c5-devkitc-1)
- GitHub Check: Default (wemos_d1_mini32)
- GitHub Check: Minimal (adafruit_qtpy_esp32s3_n4r2)
- GitHub Check: Minimal (lolin_d32_pro)
- GitHub Check: Default (lolin_s3_mini)
- GitHub Check: Minimal (adafruit_qtpy_esp32s3_nopsram)
- GitHub Check: Minimal (adafruit_qtpy_esp32s2)
- GitHub Check: Default (seeed_xiao_esp32c3)
- GitHub Check: Minimal (esp32-s3-devkitc-1)
- GitHub Check: Default (esp32dev)
- GitHub Check: Default (adafruit_qtpy_esp32s3_n4r2)
- GitHub Check: Minimal (seeed_xiao_esp32c3)
- GitHub Check: Default (seeed_xiao_esp32c6)
- GitHub Check: Default (adafruit_qtpy_esp32s3_nopsram)
- GitHub Check: Default (esp32-c6-devkitm-1)
- GitHub Check: Default (lolin_d32_pro)
- GitHub Check: Minimal (esp32-c3-devkitm-1)
- GitHub Check: Minimal (esp32dev)
- GitHub Check: Default (esp32-c3-devkitm-1)
- GitHub Check: Default (esp32-s3-devkitc-1)
- GitHub Check: Default (adafruit_qtpy_esp32s2)
- GitHub Check: Default (esp32-c5-devkitc-1)
- GitHub Check: Typical (seeed_xiao_esp32s3)
- GitHub Check: Extensive (adafruit_qtpy_esp32s3_nopsram)
- GitHub Check: Typical (esp32-s3-devkitc-1)
- GitHub Check: Typical (adafruit_qtpy_esp32s3_nopsram)
- GitHub Check: Extensive (esp32-s3-devkitc-1)
- GitHub Check: Extensive (seeed_xiao_esp32s3)
- GitHub Check: Minimal (lolin_d32_pro)
- GitHub Check: Default (seeed_xiao_esp32c6)
- GitHub Check: Default (lolin_s3_mini)
- GitHub Check: Default (lolin_d32_pro)
- GitHub Check: Default (wemos_d1_mini32)
- GitHub Check: Default (lolin_d32)
- GitHub Check: Minimal (wemos_d1_mini32)
- GitHub Check: Default (seeed_xiao_esp32c3)
- GitHub Check: Minimal (esp32-c5-devkitc-1)
- GitHub Check: Default (esp32-c6-devkitm-1)
- GitHub Check: Default (esp32-s3-devkitc-1)
- GitHub Check: Default (adafruit_qtpy_esp32s3_nopsram)
- GitHub Check: Default (esp32-c3-devkitm-1)
- GitHub Check: Minimal (seeed_xiao_esp32c3)
- GitHub Check: Default (esp32-c5-devkitc-1)
- GitHub Check: Default (adafruit_qtpy_esp32s3_n4r2)
- GitHub Check: Minimal (esp32-c6-devkitm-1)
- GitHub Check: Minimal (adafruit_qtpy_esp32s3_n4r2)
- GitHub Check: Minimal (seeed_xiao_esp32c6)
- GitHub Check: Minimal (esp32-s3-devkitc-1)
- GitHub Check: Default (seeed_xiao_esp32s3)
- GitHub Check: Default (adafruit_qtpy_esp32s2)
- GitHub Check: Default (esp32dev)
- GitHub Check: Minimal (esp32-c3-devkitm-1)
- GitHub Check: Minimal (adafruit_qtpy_esp32s3_nopsram)
- GitHub Check: Minimal (adafruit_qtpy_esp32s2)
- GitHub Check: Minimal (lolin_d32)
- GitHub Check: Minimal (seeed_xiao_esp32s3)
- GitHub Check: Minimal (lolin_s3_mini)
- GitHub Check: Minimal (esp32dev)
- GitHub Check: Typical (seeed_xiao_esp32s3)
- GitHub Check: Extensive (esp32-s3-devkitc-1)
- GitHub Check: Extensive (seeed_xiao_esp32s3)
- GitHub Check: Typical (esp32-s3-devkitc-1)
- GitHub Check: Typical (adafruit_qtpy_esp32s3_nopsram)
- GitHub Check: Extensive (adafruit_qtpy_esp32s3_nopsram)
- GitHub Check: ESPHome (2025.7.0)
- GitHub Check: ESPHome (latest)
🔇 Additional comments (1)
webapp/src/services/Modes.tsx (1)
81-85: LGTM!Also applies to: 337-341
…ub.com/Solmath/Frekvens into feature/metaballs-configuration-params
…l count and improve initialization
|
Thinking of taking a closer look at this during the weekend. Having controls in the web UI would be very much appreciated. |
|
I just pushed my latest changes that try to simplify the initialization of the contributions array and add support to change the number of balls during runtime. I should probably split this into multiple PRs, because it really touches on different topics, will try to do that over the weekend. By the way, I vibe coded a little playground app to experiment with the parameters without the need to flash the firmware on every change: https://gist.github.com/Solmath/29248d049256089fa09f7db272c2ba90 Should be working without any dependencies. |
|
Had some fun playing around with the new settings and seeing how everything interacts. The “these go to eleven” easter egg in the web UI made me smile. There's some tweaking and polishing to do, but overall this is a very welcome improvement. Looking forward to seeing the finished version. 👍🏻 |
This adds parameters to configure speed and size of the balls from the frontend.
Key changes
Impact
ToDo
Add config parameters for multiplier, feathering and number of balls.