Skip to content

Adding wizlights to the list of usermods - #375

Merged
DedeHai merged 2 commits into
wled:mainfrom
eibanez:patch-2
Sep 14, 2026
Merged

DedeHai merged 2 commits into
wled:mainfrom
eibanez:patch-2

Conversation

@eibanez

@eibanez eibanez commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

I created a separate repo for the wizlights usermod.

My intention is to remove the usermod from the main WLED repository.

cc: @ChuckMash

Summary by CodeRabbit

  • Documentation
    • Added the wizlights community usermod to the community index, including its repository, description, author, supported platforms, and license.

@coderabbitai

coderabbitai Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: f71f2573-6295-4b78-ac90-41798beaf43e

📥 Commits

Reviewing files that changed from the base of the PR and between 9d07ef5 and fd467ec.

📒 Files selected for processing (1)
  • docs/advanced/community-usermods.md

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


Walkthrough

Changes

Community usermod index

Layer / File(s) Summary
Add wizlights entry
docs/advanced/community-usermods.md
The community usermod table now lists the wizlights repository, description, author, supported platforms, and EUPL license.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Other

Suggested reviewers: softhack007

Merge Risk: ⚪ Minimal · up to fd467

This documentation-only update has bounded impact and is ready to merge.

🚥 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 clearly and concisely describes the main change: adding wizlights to the usermod list.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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.
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified 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.

❤️ Share

A rabbit hops through rows of light
Wizlights joins the index bright
Platforms gather, license clear
A tidy entry now appears
Ears up for docs that guide the way

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

@eibanez
eibanez marked this pull request as ready for review September 14, 2026 04:58
@DedeHai
DedeHai merged commit 48ff87b into wled:main Sep 14, 2026
1 check passed
@softhack007

Copy link
Copy Markdown
Member

@coderabbitai please perform an external usermod code inspection (as defined in https://github.com/wled/WLED-Docs/blob/main/.coderabbit.yaml) for this PR.
Include the inspected revision, files inspected, findings, and coverage limits in your reply.

@coderabbitai

coderabbitai Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
printf '%s\n' '--- main inspection instructions ---'
gh api repos/wled/WLED-Docs/contents/.coderabbit.yaml?ref=main --jq '.content' | base64 --decode
printf '\n%s\n' '--- PR metadata ---'
gh api repos/wled/WLED-Docs/pulls/375 --jq '{head: .head.sha, base: .base.sha, body: .body}'
printf '%s\n' '--- PR files ---'
gh api repos/wled/WLED-Docs/pulls/375/files --jq '.[] | {filename,patch}'

Length of output: 6513


🏁 Script executed:

#!/bin/bash
set -euo pipefail
printf '%s\n' '--- external repository ---'
gh api repos/eibanez/wled-usermod-wizlights --jq '{full_name,default_branch,description,license,owner:.owner.login}'
sha=$(gh api repos/eibanez/wled-usermod-wizlights/commits/HEAD --jq .sha)
printf 'EXTERNAL_SHA=%s\n' "$sha"
gh api "repos/eibanez/wled-usermod-wizlights/git/trees/$sha?recursive=1" --jq '{truncated,tree:[.tree[]|{path,type,size}]}'
printf '%s\n' '--- WLED reference revision ---'
wsha=$(gh api repos/wled/WLED/commits/main --jq .sha)
printf 'WLED_SHA=%s\n' "$wsha"
printf '%s\n' '--- AGENTS.md ---'
gh api "repos/wled/WLED/contents/AGENTS.md?ref=$wsha" --jq .content | base64 --decode
printf '\n%s\n' '--- user_fx files ---'
gh api "repos/wled/WLED/contents/usermods/user_fx?ref=$wsha" --jq '.[]|{name,path}'
printf '%s\n' '--- custom-features.md ---'
gh api repos/wled/WLED-Docs/contents/docs/advanced/custom-features.md?ref=main --jq .content | base64 --decode

Length of output: 40586


🏁 Script executed:

#!/bin/bash
set -euo pipefail
tmp=$(mktemp -d)
sha=de66f1b261348aa5fa33faf34d0d5bff1141f898
for file in wizlights.cpp library.json readme.md LICENSE .github/CODEOWNERS .github/workflows/build.yml; do
  mkdir -p "$tmp/$(dirname "$file")"
  gh api "repos/eibanez/wled-usermod-wizlights/contents/$file?ref=$sha" --jq .content | base64 --decode > "$tmp/$file"
done
printf '%s\n' '--- implementation outline ---'
ast-grep outline "$tmp/wizlights.cpp" --items all || true
for file in wizlights.cpp library.json readme.md LICENSE .github/CODEOWNERS .github/workflows/build.yml; do
  printf '\n--- %s ---\n' "$file"
  cat -n "$tmp/$file"
done
wsha=55bcf1fa16bd4c057660a2b3953b363fdd966600
for file in usermods/user_fx/README.md docs/hardening.instructions.md docs/securecode.instructions.md; do
  printf '\n--- WLED %s ---\n' "$file"
  gh api "repos/wled/WLED/contents/$file?ref=$wsha" --jq .content | base64 --decode
done

Length of output: 80977


🏁 Script executed:

#!/bin/bash
set -euo pipefail
tmp=$(mktemp -d)
sha=55bcf1fa16bd4c057660a2b3953b363fdd966600
gh api "repos/wled/WLED/git/trees/$sha?recursive=1" > "$tmp/tree.json"
printf '%s\n' '--- core candidate files ---'
jq -r '.tree[] | select(.type=="blob") | .path | select(test("(^|/)(FX\\.h|FX_fcn\\.cpp|fcn_declare\\.h|colors\\.h|wled\\.h|const\\.h)$"))' "$tmp/tree.json"
for name in FX.h FX_fcn.cpp fcn_declare.h colors.h wled.h const.h; do
  path=$(jq -r --arg n "$name" '.tree[] | select(.type=="blob") | .path | select(. == ("wled00/"+$n))' "$tmp/tree.json")
  if [ -z "$path" ]; then continue; fi
  gh api "repos/wled/WLED/contents/$path?ref=$sha" --jq .content | base64 --decode > "$tmp/$name"
  printf '\n--- outline %s ---\n' "$path"
  ast-grep outline "$tmp/$name" --items all --match 'getPixelColor|getJsonValue|Segment|getLengthTotal' || true
  printf '\n--- relevant declarations and contracts %s ---\n' "$path"
  rg -n -C4 'getJsonValue|getPixelColor\(|getLengthTotal\(|stop;|stop =|exclusive|USERMOD_ID_WIZLIGHTS|WiFiUdp|colors.h|Arduino.h' "$tmp/$name" || true
done
printf '\n%s\n' '--- changed index row at PR revision ---'
gh api 'repos/wled/WLED-Docs/contents/docs/advanced/community-usermods.md?ref=fd467ecd3d5ee92c6213723a95385434d4273cb3' --jq .content | base64 --decode | nl -ba | sed -n '25,42p'

Length of output: 29627


@softhack007 I completed the best-effort external-source inspection defined in .coderabbit.yaml. I found four actionable issues in the linked implementation. These findings apply to the usermod linked from the new index row, Line 36, not to executable changes in this documentation PR.

Inspected revision and files

Repository: https://github.com/eibanez/wled-usermod-wizlights
Revision: de66f1b261348aa5fa33faf34d0d5bff1141f898

I read all six repository files:

  • wizlights.cpp
  • library.json
  • readme.md
  • LICENSE
  • .github/CODEOWNERS
  • .github/workflows/build.yml

I also read the three required WLED references and the WLED security guidance. I checked relevant core declarations and implementation excerpts at WLED revision 55bcf1fa16bd4c057660a2b3953b363fdd966600.

Findings

1. High — Configured delays block the WLED main loop

wizlights.cpp, Line 126

loop() calls delay(sendDelay) after each updated light. Fifteen updated lights with a configured delay of 100 ms block normal WLED main-loop processing for approximately 1.5 seconds per pass.

The configuration reader accepts sendDelay without a range check at Line 155. Large values can cause much longer stalls.

Fix direction: Replace the delays with a millis()-based scheduler. Send the next light update when its deadline arrives, then return from loop().

2. Medium — Pixel indices above 255 select the wrong pixel

wizlights.cpp, Line 30, and Line 118

pixelIndex is uint16_t, but getPixelData() accepts uint8_t. An otherwise valid offset of 300 therefore reads pixel 44. The preceding strip-length check does not prevent this narrowing conversion.

Fix direction: Use uint16_t or unsigned for the pix parameter.

3. Medium — The segment lookup includes an exclusive stop index

wizlights.cpp, Line 46

The condition uses pix <= seg.stop. WLED treats stop as exclusive, as shown by its core segment traversal.

For adjacent segments [0,10) and [10,20), pixel 10 receives the first segment’s CCT because the lookup stops at the first match.

Fix direction: Use pix < seg.stop.

4. Medium — The configured refresh timeout can overflow

wizlights.cpp, Line 121

forceUpdateMinutes is a signed long. The code multiplies it by 60000 without checking its range. On the target platforms, 35,792 minutes already exceeds the signed 32-bit multiplication range. Negative values also produce an unsuitable timeout.

Fix direction: Validate the configured range before use. Convert the validated value to unsigned milliseconds with overflow-safe arithmetic.

These are correctness and availability findings. I did not establish an unauthenticated remote exploit.

Other checks

  • Index metadata: The repository URL, description, author, and EUPL license agree with the public repository.
  • Integration: Usermod inheritance, REGISTER_USERMOD(), and build.libArchive: false are present. The includes use WLED or framework facilities; I found no missing third-party dependency declaration.
  • Platforms: The source appears compatible with ESP32 and ESP8266. The workflow targets only esp32dev, so it does not substantiate both platform claims.
  • GPIO/I2C: The implementation does not directly access GPIO or initialize an I2C bus.
  • Input tracing: Configuration values feed pixel selection, timing, and outbound WiZ UDP messages. The implementation defines no MQTT, ESP-NOW, JSON-state, or UDP receive handlers.
  • Security and scope: I found no apparent backdoor, malware, leaked secret, unrelated device-configuration change, or undocumented additional functionality in the inspected files.

Coverage limits

All external files were accessible. This was static inspection only. I did not compile firmware, execute repository code, test hardware, or validate WiZ network behavior. I did not audit WLED core, framework implementations, action dependencies, or repository history in full.

This inspection is not proof of safety, WLED testing, endorsement, or a complete security audit.

You are interacting with an AI system.

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.

3 participants