-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add set_buffer to tm1637 #6021
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
Add set_buffer to tm1637 #6021
Conversation
* Add ir/rf proxy to ready made projects * copy Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update themes/esphome-theme/layouts/_default/projects.html Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> --------- Co-authored-by: Keith Burzinski <kbx81x@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
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.
As this is a feature matched with a PR in https://github.com/esphome/esphome, please target your PR to the next branch and rebase.
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
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.
Pull request overview
Adds documentation for writing raw segment bytes to TM1637 displays via the new set_buffer API.
Changes:
- Documented a new “Raw segment buffer” section describing
set_bufferusage. - Added a YAML/lambda example showing raw segment values and decimal point (bit 7 /
0x80).
|
|
||
|
|
Copilot
AI
Feb 1, 2026
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.
There are two consecutive empty lines here before the “Creating a digital clock” heading. Please remove the extra blank lines to keep spacing consistent with the rest of the document.
WalkthroughAdded documentation for the TM1637 display's raw segment buffer feature, describing the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
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
🤖 Fix all issues with AI agents
In `@content/components/display/tm1637.md`:
- Around line 125-126: Remove the multiple consecutive blank lines in the TM1637
display markdown section and collapse them to a single blank line so the file no
longer has consecutive empty lines; edit the tm1637.md content around the
documented display section to leave only one blank line between
paragraphs/headings.
- Around line 191-198: Clarify that the TM1637::set_buffer call always expects
six bytes corresponding to the hardware's full 6-digit buffer (even if your
config uses length: 4), and update the example/description around the lambda and
set_buffer usage to state that unused digit positions must be padded (e.g., with
0x00) so callers know to always supply six values to set_buffer.
|
|
||
|
|
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.
Remove extra blank lines to satisfy lint.
Lint reports multiple consecutive blank lines here. Collapse to a single blank line.
🔧 Proposed fix
-
-📝 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.
🧰 Tools
🪛 GitHub Check: Lint
[failure] 126-126:
Multiple consecutive blank lines [Expected: 1; Actual: 3]
[failure] 125-125:
Multiple consecutive blank lines [Expected: 1; Actual: 2]
🤖 Prompt for AI Agents
In `@content/components/display/tm1637.md` around lines 125 - 126, Remove the
multiple consecutive blank lines in the TM1637 display markdown section and
collapse them to a single blank line so the file no longer has consecutive empty
lines; edit the tm1637.md content around the documented display section to leave
only one blank line between paragraphs/headings.
| ```yaml | ||
| display: | ||
| - platform: tm1637 | ||
| # ... | ||
| lambda: |- | ||
| // Raw segment values for "0123" with the dot on the last digit | ||
| it.set_buffer(0x3f, 0x06, 0x5b, 0x4f | 0x80, 0x00, 0x00); | ||
| ``` |
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.
🧩 Analysis chain
🏁 Script executed:
# Find tm1637-related source files
find . -type f \( -name "*tm1637*" -o -name "*TM1637*" \) | head -20Repository: esphome/esphome-docs
Length of output: 361
🏁 Script executed:
# Search for set_buffer method definition in cpp/h files
rg -l 'set_buffer' --type=cppRepository: esphome/esphome-docs
Length of output: 212
🏁 Script executed:
# Look for TM1637 class/component definition
rg 'class.*TM1637' --type=cpp -A 10Repository: esphome/esphome-docs
Length of output: 212
🏁 Script executed:
# Read the tm1637.md file to see the full context
wc -l ./content/components/display/tm1637.mdRepository: esphome/esphome-docs
Length of output: 106
🏁 Script executed:
# Read the section around lines 191-198 to get more context
sed -n '170,220p' ./content/components/display/tm1637.mdRepository: esphome/esphome-docs
Length of output: 1227
🏁 Script executed:
# Search for "set_buffer" in the documentation
rg -n 'set_buffer' ./content/components/display/tm1637.md -B5 -A5Repository: esphome/esphome-docs
Length of output: 825
🏁 Script executed:
# Search for "buffer" references to understand sizing
rg -n -i 'buffer' ./content/components/display/tm1637.mdRepository: esphome/esphome-docs
Length of output: 280
🏁 Script executed:
# Check what's in the See Also section and look for API references
sed -n '200,204p' ./content/components/display/tm1637.mdRepository: esphome/esphome-docs
Length of output: 252
🏁 Script executed:
# Search for any other mentions of buffer or configuration examples
rg -n 'lambda' ./content/components/display/tm1637.mdRepository: esphome/esphome-docs
Length of output: 504
🏁 Script executed:
# Look for configuration documentation that might mention display dimensions
rg -n -i 'digit\|config\|buffer' ./content/components/display/tm1637.md | head -20Repository: esphome/esphome-docs
Length of output: 46
🏁 Script executed:
# Read the first part of the file to understand configuration structure
sed -n '1,100p' ./content/components/display/tm1637.mdRepository: esphome/esphome-docs
Length of output: 4765
🏁 Script executed:
# Look for all lambda examples to see if there's a pattern
rg -n 'it\.' ./content/components/display/tm1637.mdRepository: esphome/esphome-docs
Length of output: 596
Clarify set_buffer byte count to match TM1637 buffer capacity.
The example passes 6 bytes (the TM1637 hardware buffer size supporting up to 6 digits), but this isn't explained. Readers seeing a 4-digit length: 4 config may expect only 4 bytes. Add a note that set_buffer always requires 6 bytes representing the full buffer capacity, with unused positions padded as needed (e.g., 0x00).
🤖 Prompt for AI Agents
In `@content/components/display/tm1637.md` around lines 191 - 198, Clarify that
the TM1637::set_buffer call always expects six bytes corresponding to the
hardware's full 6-digit buffer (even if your config uses length: 4), and update
the example/description around the lambda and set_buffer usage to state that
unused digit positions must be padded (e.g., with 0x00) so callers know to
always supply six values to set_buffer.
✅ Deploy Preview for esphome ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Base branch has been corrected - dismissing previous review.
* Add ir/rf proxy to ready made projects * copy Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update themes/esphome-theme/layouts/_default/projects.html Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> --------- Co-authored-by: Keith Burzinski <kbx81x@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
…to origin/next
|
re-create clean |
Description:
Pull request in esphome with YAML changes (if applicable):
Checklist:
I am merging into
nextbecause this is new documentation that has a matching pull-request in esphome as linked above.or
I am merging into
currentbecause this is a fix, change and/or adjustment in the current documentation and is not for a new component or feature.Link added in
/components/_index.mdwhen creating new documents for new components or cookbook.Added set_buffer to tm1637