-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Integrate a 11x11 Grid to the Wordclock Usermod #4781
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe word clock usermod was updated to support both 11x10 and 11x11 pixel matrix configurations by adjusting LED count macros and remapping LED indices in mask arrays. Documentation was revised to include details about the new 11x11 grid option and updated wiring pattern switches. JSON config and state handling were extended to accommodate the new wiring option and revised key naming. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches🧪 Generate 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
adding the svg violates the license. just add a link in the readme. @Hasenpups can you please review? I think you added the original. |
Added a Link to the source of the SVG
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
usermods/usermod_v2_word_clock/readme.md (2)
3-3
: Use the correct indefinite article.“…or an 11x11 pixel matrix…”
Small grammar tweak keeps the intro professional.-This usermod drives an 11x10 or a 11x11 pixel matrix wordclock with WLED. +This usermod drives an 11x10 or an 11x11 pixel matrix word-clock with WLED.
21-22
: Fix typos and replace bare URL; double-check license wording.
- Spelling: “integreated” → “integrated”, “Grafics” → “graphics”.
- Style: avoid bare URL (MD034).
- Licensing: make it explicit that the SVG itself is not shipped and that the link respects the original license (the current phrasing “I integrated the graphics” could be read as embedding).
-## 11x11 Grid -I integreated the Grafics from https://github.com/panbachi/wordclock/blob/master/graphics/plate/de_DE_s1.svg +## 11×11 Grid +The 11×11 layout is based on the external SVG +[de_DE_s1.svg](https://github.com/panbachi/wordclock/blob/master/graphics/plate/de_DE_s1.svg) (linked only, not redistributed here; please refer to the original repository for licensing details).Please confirm that no copy of the SVG is committed elsewhere in the PR to stay license-compliant.
If you like, I can script-search the tree for stray.svg
additions.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
usermods/usermod_v2_word_clock/readme.md
(2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: KrX3D
PR: wled/WLED#4585
File: usermods/seven_segment_display_reloaded_v2/seven_segment_display_reloaded_v2.h:121-137
Timestamp: 2025-04-27T10:06:22.545Z
Learning: In the Seven Segment Display Reloaded usermod, the dimension mismatch between the default array (umSSDRNumbers[11][7]) and the override (umSSDRNumbers[11][10] = umSSDR_NUMBERS) is intentional by design, allowing for different use cases with varying numbers of segments per digit.
Learnt from: willmmiles
PR: wled/WLED#4623
File: usermods/word-clock-matrix/word-clock-matrix.cpp:332-332
Timestamp: 2025-03-29T01:22:54.617Z
Learning: In the WLED project, hardcoded usermod IDs (like 500 in the WordClockMatrix's getId() method) are intentionally used as part of a strategy to avoid modifying core code. There are plans to remove numeric usermod IDs entirely in the future.
Learnt from: DedeHai
PR: wled/WLED#4682
File: wled00/FX.cpp:9016-9039
Timestamp: 2025-05-09T18:48:21.296Z
Learning: WLED does not support matrices large enough (≥1024 px) for 32-bit overflow in dx*dx + dy*dy to be a practical concern in particle system effects.
usermods/usermod_v2_word_clock/readme.md (5)
Learnt from: willmmiles
PR: wled/WLED#4623
File: usermods/word-clock-matrix/word-clock-matrix.cpp:332-332
Timestamp: 2025-03-29T01:22:54.617Z
Learning: In the WLED project, hardcoded usermod IDs (like 500 in the WordClockMatrix's getId() method) are intentionally used as part of a strategy to avoid modifying core code. There are plans to remove numeric usermod IDs entirely in the future.
Learnt from: KrX3D
PR: wled/WLED#4585
File: usermods/seven_segment_display_reloaded_v2/seven_segment_display_reloaded_v2.h:121-137
Timestamp: 2025-04-27T10:06:22.545Z
Learning: In the Seven Segment Display Reloaded usermod, the dimension mismatch between the default array (umSSDRNumbers[11][7]) and the override (umSSDRNumbers[11][10] = umSSDR_NUMBERS) is intentional by design, allowing for different use cases with varying numbers of segments per digit.
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: KrX3D
PR: wled/WLED#4585
File: usermods/seven_segment_display_reloaded_v2/seven_segment_display_reloaded_v2.h:121-136
Timestamp: 2025-04-27T09:37:28.415Z
Learning: Using PROGMEM for the seven-segment font array (umSSDRNumbers) in the WLED SSDR usermod causes compilation problems, so it should be left as a regular array.
🪛 LanguageTool
usermods/usermod_v2_word_clock/readme.md
[grammar] ~3-~3: Ensure spelling is correct
Context: # Word Clock Usermod V2 This usermod drives an 11x10 or a 11x11 pixel matrix...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~22-~22: Ensure spelling is correct
Context: ... grid. ## 11x11 Grid I integreated the Grafics from https://github.com/panbachi/wordcl...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🪛 markdownlint-cli2 (0.17.2)
usermods/usermod_v2_word_clock/readme.md
22-22: Bare URL used
(MD034, no-bare-urls)
I added the Link in the readme.txt It is https://github.com/panbachi/wordclock/blob/master/graphics/plate/de_DE_s1.svg |
Mapping wrong at 11x11 ---> eins
Added map for a 2d Matrix in Meanderwiring
Added meander wiring for a 2d Matrix 11x11
Add the Status of the usermod in JSON, so that you can switch off and on the Usermod remotely for Example with Home Assistant
Added the integration into Homeassist
Added HA Configuration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🔭 Outside diff range comments (1)
usermods/usermod_v2_word_clock/readme.md (1)
8-9
: Fix the option name typo (“diplayItIs”).
The flag is spelleddisplayItIs
in code; the doc currently showsdiplayItIs
, which will mislead users.-diplayItIs: enable/disable display of "Es ist" on the clock +displayItIs: enable/disable display of "Es ist" on the clock
🧹 Nitpick comments (3)
usermods/usermod_v2_word_clock/readme.md (3)
3-3
: Use the correct article and casing for “11x11 Word Clock”.
“11” is pronounced “eleven”, so it takes the article an. Also, “Word Clock” is a proper noun in this context.-This usermod drives an 11x10 or a 11x11 pixel matrix wordclock with WLED. +This usermod drives an **11×10** or **an 11×11** pixel-matrix **Word Clock** with WLED.
21-23
: Correct spelling and convert bare URL to Markdown link.
Minor language issues (“integreated”, “Grafics”) and MD034 violation.-## 11x11 Grid -I integreated the Grafics from https://github.com/panbachi/wordclock/blob/master/graphics/plate/de_DE_s1.svg +## 11×11 Grid +I integrated the graphics from \ +[panbachi/wordclock – de_DE_s1.svg](https://github.com/panbachi/wordclock/blob/master/graphics/plate/de_DE_s1.svg)
68-101
: Normalise unordered list style and indentation.
markdownlint
flags inconsistent use of-
vs*
and mixed indentation levels. Unifying to a single style keeps the doc lint-clean.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
usermods/usermod_v2_word_clock/readme.md
(3 hunks)usermods/usermod_v2_word_clock/usermod_v2_word_clock.cpp
(13 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- usermods/usermod_v2_word_clock/usermod_v2_word_clock.cpp
🧰 Additional context used
🪛 LanguageTool
usermods/usermod_v2_word_clock/readme.md
[grammar] ~3-~3: Ensure spelling is correct
Context: # Word Clock Usermod V2 This usermod drives an 11x10 or a 11x11 pixel matrix...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~22-~22: Ensure spelling is correct
Context: ... grid. ## 11x11 Grid I integreated the Grafics from https://github.com/panbachi/wordcl...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🪛 markdownlint-cli2 (0.17.2)
usermods/usermod_v2_word_clock/readme.md
22-22: Bare URL used
(MD034, no-bare-urls)
68-68: Unordered list style
Expected: asterisk; Actual: dash
(MD004, ul-style)
68-68: Unordered list indentation
Expected: 0; Actual: 2
(MD007, ul-indent)
71-71: Unordered list style
Expected: asterisk; Actual: dash
(MD004, ul-style)
71-71: Unordered list indentation
Expected: 2; Actual: 6
(MD007, ul-indent)
78-78: Unordered list style
Expected: asterisk; Actual: dash
(MD004, ul-style)
78-78: Unordered list indentation
Expected: 0; Actual: 2
(MD007, ul-indent)
79-79: Unordered list style
Expected: asterisk; Actual: dash
(MD004, ul-style)
79-79: Unordered list indentation
Expected: 2; Actual: 6
(MD007, ul-indent)
I added a switch in usermod called "meanderwiring" to enable/disable the alternate wiring pattern and a switch for the 11x11 grid. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Synchronise key names with the implementation.
Code renamed the JSON key to meanderWiring
and added wiring11x11
(or eleven
) for the grid size. The doc still references "meanderwiring"
and a generic “switch for the 11x11 grid”. Update to avoid configuration mismatches.
-I added a switch in usermod called "meanderwiring" to enable/disable the alternate wiring pattern and a switch for the 11x11 grid.
+The usermod now exposes two Boolean options
+* **meanderWiring** – enable/disable the alternate meander wiring pattern
+* **wiring11x11** – select the 11 × 11 grid instead of the default 11 × 10
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
I added a switch in usermod called "meanderwiring" to enable/disable the alternate wiring pattern and a switch for the 11x11 grid. | |
@@ -19,1 +19,3 File: usermods/usermod_v2_word_clock/readme.md | |
-I added a switch in usermod called "meanderwiring" to enable/disable the alternate wiring pattern and a switch for the 11x11 grid. | |
+The usermod now exposes two Boolean options | |
+* **meanderWiring** – enable/disable the alternate meander wiring pattern | |
+* **wiring11x11** – select the 11 × 11 grid instead of the default 11 × 10 |
🤖 Prompt for AI Agents
In usermods/usermod_v2_word_clock/readme.md around lines 19 to 20, the
documentation uses outdated key names "meanderwiring" and a generic description
for the 11x11 grid switch. Update the documentation to use the exact JSON key
names "meanderWiring" and "wiring11x11" (or "eleven") as implemented in the code
to ensure consistency and prevent configuration mismatches.
YAML | ||
|
||
# configuration.yaml | ||
|
||
# 1. REST command to send on/off commands to the WLED usermod | ||
rest_command: | ||
wled_wordclock_set: | ||
# REPLACE: Enter the IP address of your WLED device here | ||
url: "http://YOUR_WLED_IP_ADDRESS/json/state" | ||
method: "POST" | ||
headers: | ||
Content-Type: "application/json" | ||
# Forces 'true'/'false' to be lowercase to generate valid JSON | ||
payload: '{"WordClockUsermod":{"active":{{ active | string | lower }}}}' | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Wrap the Home Assistant snippet in a fenced code block.
Without back-ticks the YAML loses indentation when copied, leading to parsing errors.
-YAML
+# Home Assistant – configuration.yaml
+```yaml
# configuration.yaml
...
# Forces 'true'/'false' to be lowercase to generate valid JSON
payload: '{"WordClockUsermod":{"active":{{ active | string | lower }}}}'
+```
🤖 Prompt for AI Agents
In usermods/usermod_v2_word_clock/readme.md between lines 51 and 65, the YAML
snippet for the Home Assistant configuration is not enclosed in a fenced code
block, causing indentation loss and parsing errors when copied. To fix this,
wrap the entire YAML snippet with triple back-ticks (```) before and after the
code block, specifying 'yaml' after the opening back-ticks to preserve
formatting and syntax highlighting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
usermods/usermod_v2_word_clock/readme.md (1)
19-20
: Synchronise JSON key names with the implementation.
Same issue was flagged earlier; the doc still lists the old keys.
🧹 Nitpick comments (4)
usermods/usermod_v2_word_clock/readme.md (4)
3-3
: Fix article agreement (“an 11×11”).Change “a 11x11” → “an 11x11” for correct grammar.
-This usermod drives an 11x10 or a 11x11 pixel matrix wordclock with WLED. +This usermod drives an 11x10 or an 11x11 pixel-matrix word clock with WLED.
22-23
: Spelling & markdown polish for the 11×11 section.
- “Integreated” → “integrated” and “Grafics” → “graphics”.
- Wrap bare URL in markdown link to satisfy MD034.
-## 11x11 Grid -I integreated the Grafics from https://github.com/panbachi/wordclock/blob/master/graphics/plate/de_DE_s1.svg +## 11×11 Grid +I integrated the graphics from \ +[panbachi/wordclock › de_DE_s1.svg](https://github.com/panbachi/wordclock/blob/master/graphics/plate/de_DE_s1.svg)
51-52
: Remove stray “YAML” label and rely on a fenced code block header.
This single word adds no value and breaks linting rules.-YAML - -`configuration.yaml` +`configuration.yaml`
54-54
: Specify the language on the fenced block.Add
yaml
after the opening back-ticks to satisfy MD040 and keep indentation when copied.-``` +```yaml
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
usermods/usermod_v2_word_clock/readme.md
(3 hunks)
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: willmmiles
PR: wled/WLED#4623
File: usermods/word-clock-matrix/word-clock-matrix.cpp:332-332
Timestamp: 2025-03-29T01:22:54.617Z
Learning: In the WLED project, hardcoded usermod IDs (like 500 in the WordClockMatrix's getId() method) are intentionally used as part of a strategy to avoid modifying core code. There are plans to remove numeric usermod IDs entirely in the future.
Learnt from: KrX3D
PR: wled/WLED#4585
File: usermods/seven_segment_display_reloaded_v2/seven_segment_display_reloaded_v2.h:121-137
Timestamp: 2025-04-27T10:06:22.545Z
Learning: In the Seven Segment Display Reloaded usermod, the dimension mismatch between the default array (umSSDRNumbers[11][7]) and the override (umSSDRNumbers[11][10] = umSSDR_NUMBERS) is intentional by design, allowing for different use cases with varying numbers of segments per digit.
📚 Learning: in the wled project, hardcoded usermod ids (like 500 in the wordclockmatrix's getid() method) are in...
Learnt from: willmmiles
PR: wled/WLED#4623
File: usermods/word-clock-matrix/word-clock-matrix.cpp:332-332
Timestamp: 2025-03-29T01:22:54.617Z
Learning: In the WLED project, hardcoded usermod IDs (like 500 in the WordClockMatrix's getId() method) are intentionally used as part of a strategy to avoid modifying core code. There are plans to remove numeric usermod IDs entirely in the future.
Applied to files:
usermods/usermod_v2_word_clock/readme.md
📚 Learning: in the seven segment display reloaded usermod, the dimension mismatch between the default array (ums...
Learnt from: KrX3D
PR: wled/WLED#4585
File: usermods/seven_segment_display_reloaded_v2/seven_segment_display_reloaded_v2.h:121-137
Timestamp: 2025-04-27T10:06:22.545Z
Learning: In the Seven Segment Display Reloaded usermod, the dimension mismatch between the default array (umSSDRNumbers[11][7]) and the override (umSSDRNumbers[11][10] = umSSDR_NUMBERS) is intentional by design, allowing for different use cases with varying numbers of segments per digit.
Applied to files:
usermods/usermod_v2_word_clock/readme.md
📚 Learning: in wled's fx.h, mode_count represents the highest fx_mode_ id + 1, not the total count of fx_mode_ d...
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Applied to files:
usermods/usermod_v2_word_clock/readme.md
📚 Learning: using progmem for the seven-segment font array (umssdrnumbers) in the wled ssdr usermod causes compi...
Learnt from: KrX3D
PR: wled/WLED#4585
File: usermods/seven_segment_display_reloaded_v2/seven_segment_display_reloaded_v2.h:121-136
Timestamp: 2025-04-27T09:37:28.415Z
Learning: Using PROGMEM for the seven-segment font array (umSSDRNumbers) in the WLED SSDR usermod causes compilation problems, so it should be left as a regular array.
Applied to files:
usermods/usermod_v2_word_clock/readme.md
📚 Learning: in wled, essential configuration files that require backup have short, controlled names (like "/cfg....
Learnt from: DedeHai
PR: wled/WLED#4793
File: wled00/file.cpp:481-513
Timestamp: 2025-07-31T18:21:49.868Z
Learning: In WLED, essential configuration files that require backup have short, controlled names (like "/cfg.json", "/presets.json") that are well within a 32-character buffer limit. The file naming is controlled by developers, making buffer overflow in backup filename construction highly unlikely.
Applied to files:
usermods/usermod_v2_word_clock/readme.md
🪛 LanguageTool
usermods/usermod_v2_word_clock/readme.md
[grammar] ~3-~3: Ensure spelling is correct
Context: # Word Clock Usermod V2 This usermod drives an 11x10 or a 11x11 pixel matrix...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~22-~22: Ensure spelling is correct
Context: ... grid. ## 11x11 Grid I integreated the Grafics from https://github.com/panbachi/wordcl...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🪛 markdownlint-cli2 (0.17.2)
usermods/usermod_v2_word_clock/readme.md
22-22: Bare URL used
(MD034, no-bare-urls)
54-54: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
active: false | ||
# Uses the state of the sensor to display the switch state (on/off) | ||
state: > | ||
{{ is_state('sensor.wled_wordclock_status', 'True') }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Boolean comparison uses wrong capitalisation.
value_json
returns lowercase true/false
; comparing to 'True'
will keep the switch permanently off.
- {{ is_state('sensor.wled_wordclock_status', 'True') }}
+ {{ is_state('sensor.wled_wordclock_status', 'true') }}
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
{{ is_state('sensor.wled_wordclock_status', 'True') }} | |
{{ is_state('sensor.wled_wordclock_status', 'true') }} |
🤖 Prompt for AI Agents
In usermods/usermod_v2_word_clock/readme.md at line 92, the boolean comparison
uses incorrect capitalization by comparing to the string 'True'. Change the
comparison to use lowercase 'true' to match the actual value returned by
value_json, ensuring the switch functions correctly.
I added a support for a 11x11 Wordclock and integrated a SVG from https://github.com/panbachi/wordclock that I used before
Summary by CodeRabbit
New Features
Documentation