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 9 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.
|
Warning Review limit reached
Next review available in: 23 minutes Limit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?Wait for the limit to reset, then comment An organization admin can change what happens after included review limits in Billing. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
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 |
| UINT8_MAX)); | ||
| brightness = static_cast<uint8_t>(min<uint16_t>( | ||
| static_cast<uint16_t>(brightness) + contributions[static_cast<uint8_t>(min<float>( | ||
| distanceSq * feathering / radiusSq, 255.0F))], |
There was a problem hiding this comment.
Not sure if using 1U << 6U was intentional. I set feathering to 255U so all buckets of the contributions array will be used. This gives a much smoother look (especially for bigger balls). I would suggest to make feathering configurable as well.
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
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.