Skip to content

feat: Add support for the AudioReactive usermod#2086

Open
mcaulifn wants to merge 1 commit into
frenck:mainfrom
mcaulifn:mcaulifn/audio-reactive
Open

feat: Add support for the AudioReactive usermod#2086
mcaulifn wants to merge 1 commit into
frenck:mainfrom
mcaulifn:mcaulifn/audio-reactive

Conversation

@mcaulifn

@mcaulifn mcaulifn commented Jun 11, 2026

Copy link
Copy Markdown

Proposed Changes

This PR adds support for the AudioReactive usermod, which provides sound-reactive effects on WLED devices equipped with a microphone or receiving audio via UDP sound sync.

  • Adds an AudioReactive model, exposed as State.audio_reactive. It is None when the usermod is not installed on the device, so existing devices are unaffected.
  • Adds a WLED.audio_reactive(on=...) method to enable or disable the usermod.

Related Issues

Summary by CodeRabbit

  • New Features
    • Added support for the AudioReactive usermod, enabling control over audio-reactive lighting modes.

Copilot AI review requested due to automatic review settings June 11, 2026 01:06
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5a19901c-b79b-4821-8020-42cc59dbd6b8

📥 Commits

Reviewing files that changed from the base of the PR and between 67b0142 and 6d362d0.

📒 Files selected for processing (5)
  • src/wled/__init__.py
  • src/wled/models.py
  • src/wled/wled.py
  • tests/test_models.py
  • tests/test_wled.py

📝 Walkthrough

Walkthrough

This PR adds WLED AudioReactive usermod support by defining a data model for the feature, exporting it publicly, implementing a control method, and providing comprehensive test coverage for model deserialization and API integration.

Changes

AudioReactive Usermod Feature

Layer / File(s) Summary
AudioReactive data model
src/wled/models.py
AudioReactive dataclass with on: bool field and new audio_reactive: AudioReactive | None field on State (alias "AudioReactive").
Public API export
src/wled/__init__.py
AudioReactive imported from models and added to __all__ for public API availability.
Audio reactive control method
src/wled/wled.py
New async def audio_reactive(self, *, on: bool) -> None method POSTs {"AudioReactive": {"enabled": on}} to /json/state endpoint.
Model and integration tests
tests/test_models.py, tests/test_wled.py
Tests verify audio_reactive deserializes to None when absent and correctly captures on flag when present; integration tests confirm POST payload with both True and False cases.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Poem

🐰 A rabbit hops with audio cheer,
Reactive beats now crystal clear!
Toggle on with just a call,
The usermod dances through it all! 🎵

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: Add support for the AudioReactive usermod' clearly and concisely summarizes the main change: introducing AudioReactive usermod support with model, state field, and control method.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds first-class support for the WLED “AudioReactive” usermod, including state deserialization and a client API to toggle it.

Changes:

  • Add AudioReactive model and expose it on State as audio_reactive.
  • Add WLED.audio_reactive(on=...) to toggle the usermod via /json/state.
  • Add unit tests for deserialization and request payload generation.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/test_wled.py Adds client-level test for posting AudioReactive enable/disable payload.
tests/test_models.py Adds model tests for presence/absence of State.audio_reactive.
src/wled/wled.py Adds audio_reactive() client method posting the usermod toggle.
src/wled/models.py Introduces AudioReactive model and adds it to State with aliasing.
src/wled/init.py Exports AudioReactive as part of the public package API.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/wled/wled.py
Comment thread src/wled/__init__.py
Comment thread src/wled/__init__.py
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