Repository navigation
Fix debug build compilation error in BH1750 usermod - #6019
Conversation
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes.
|
| Layer / File(s) | Summary |
|---|---|
Brightness log output usermods/BH1750_v2/BH1750_v2.cpp |
The brightness log uses separate calls for the label, lux value, and lx suffix. The usermod registration remains unchanged. |
Estimated code review effort: 1 (Trivial) | ~3 minutes
Change: Bug fix
Suggested reviewers: netmindz, albarlow
Merge Risk: 
Minimal · previous review ee04a
-
This fixes a compile error in debug builds of the BH1750 usermod. The printed text and value are unchanged, and no merge-blocking risk is evident.
Pre-merge checks: 
4
-
Full details: Title check
-
Explanation
The title names the main change: fixing a debug build compilation error in the BH1750 usermod. The raw summary describes splitting the brightness debug output into three print calls instead of one concatenated string, which removes the failing F() plus String concatenation. The PR objectives confirm that the error came from concatenating an F(...) flash string with a String under -D WLED_DEBUG. The title matches the changeset.
-
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.
What it does
Fixes a compilation error in the luminance (BH1750) usermod when building the firmware with debug logging enabled (-D WLED_DEBUG).
Additional references and context
How it works
Direct concatenation of const __FlashStringHelper* (F(...)) with + fails to compile (invalid operands of types 'const __FlashStringHelper*' and 'String' to binary 'operator+'). Splitting the log output into sequential DEBUG_PRINT / DEBUG_PRINTLN calls fixes the build error and avoids creating temporary String objects on the heap.
AI assistance: yes
Testing and Validation
Tested on actual hardware:
Open ends, known limitations, breaking changes:
Anything you couldn't quite solve?
Checklist
Summary by CodeRabbit