Skip to content

Remove V1 usermod #4828

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Remove V1 usermod #4828

wants to merge 1 commit into from

Conversation

netmindz
Copy link
Member

@netmindz netmindz commented Aug 9, 2025

Remove legacy usermod

Summary by CodeRabbit

  • Refactor

    • Streamlined the usermod integration by removing legacy user callback functions and related declarations.
    • Updated internal logic to use the UsermodManager for usermod lifecycle events.
  • Chores

    • Removed unused template code and documentation for custom usermod functions.

@netmindz netmindz added this to the 0.16.0 candidate milestone Aug 9, 2025
Copy link
Contributor

coderabbitai bot commented Aug 9, 2025

Walkthrough

This change removes the legacy usermod callback functions (userSetup(), userConnected(), userLoop()) from the codebase. Their declarations are deleted from the header, their empty implementation file is removed, and all direct invocations are replaced with calls to the UsermodManager equivalents in the main application logic.

Changes

Cohort / File(s) Change Summary
Header Cleanup
wled00/fcn_declare.h
Removed declarations of userSetup(), userConnected(), and userLoop() functions.
Legacy Usermod Removal
wled00/usermod.cpp
Deleted the entire file containing empty stubs for the legacy usermod functions.
Main Application Callback Update
wled00/wled.cpp
Replaced direct calls to legacy usermod functions with UsermodManager lifecycle method calls.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Note

🔌 MCP (Model Context Protocol) integration is now available in Early Access!

Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e3653ba and 0a21869.

📒 Files selected for processing (3)
  • wled00/fcn_declare.h (0 hunks)
  • wled00/usermod.cpp (0 hunks)
  • wled00/wled.cpp (0 hunks)
💤 Files with no reviewable changes (3)
  • wled00/usermod.cpp
  • wled00/wled.cpp
  • wled00/fcn_declare.h
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: wled_build / Build Environments (esp32c3dev)
  • GitHub Check: wled_build / Build Environments (nodemcuv2_compat)
  • GitHub Check: wled_build / Build Environments (esp32dev_V4)
  • GitHub Check: wled_build / Build Environments (esp01_1m_full_160)
  • GitHub Check: wled_build / Build Environments (esp01_1m_full_compat)
  • GitHub Check: wled_build / Build Environments (esp8266_2m_compat)
  • GitHub Check: wled_build / Build Environments (esp8266_2m_160)
  • GitHub Check: wled_build / Build Environments (nodemcuv2_160)
  • GitHub Check: wled_build / Build Environments (esp01_1m_full)
  • GitHub Check: wled_build / Build Environments (esp8266_2m)
  • GitHub Check: wled_build / Build Environments (nodemcuv2)
  • GitHub Check: wled_build / Build Environments (esp32_eth)
  • GitHub Check: wled_build / Build Environments (esp32s3dev_16MB_opi)
  • GitHub Check: wled_build / Build Environments (esp01_1m_full_160)
  • GitHub Check: wled_build / Build Environments (usermods)
  • GitHub Check: wled_build / Build Environments (esp01_1m_full_compat)
  • GitHub Check: wled_build / Build Environments (lolin_s2_mini)
  • GitHub Check: wled_build / Build Environments (esp8266_2m_compat)
  • GitHub Check: wled_build / Build Environments (nodemcuv2_compat)
  • GitHub Check: wled_build / Build Environments (nodemcuv2)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch remove-v1-usermod

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@willmmiles
Copy link
Member

There are several v1 usermods still in the tree -- they should get ported to v2 before we merge this. As it turns out, the v1 usermod binding is actually fully compatible with the "usermods as libraries" approach, though you can only enable one (it'll throw a linker error otherwise).

@netmindz
Copy link
Member Author

How does that work then? Does the compiler just treat the CPP fille as if it's a duplicate header definition as the function is empty and magically switch to the version in the other directory if on the include path?

@willmmiles
Copy link
Member

Well blow me sideways - I wrote it months ago, but I never merged that patch! It was in my TTGO-T-Display usermod branch, PR #4600. I'd flagged it as draft as I didn't have the hardware to test it. (I have something "close enough" on my test block now; works fine, I should dust it off and submit.)

But yes - that's pretty much how it works, through the power of weak symbols. The definitions in wled00/usermod.cpp can be flagged to be linked in only if no other source file defines them.

Sorry for the confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants