[Inkplate] Update for new refactor#6853
Conversation
There was a problem hiding this comment.
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 👍 |
✅ Deploy Preview for esphome ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
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.
WalkthroughReorganized the Inkplate display docs around supported models, minimal configuration, board-specific wiring examples, rendering usage, grayscale mode, partial updates, and updated related links. ChangesInkplate documentation rewrite
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/content/docs/components/display/inkplate.mdx`:
- Around line 287-297: The Inkplate partial-update example in the display block
references IDs that are not defined in the same snippet, so it is not
self-contained. Update the example to either define the required entities in
this page’s snippet or replace the references in the lambda so it only uses
symbols introduced here, specifically the lambda, id(esptime), and
id(roboto_48). Make sure the displayed configuration can be validated on its own
without relying on earlier examples.
- Around line 39-53: The minimal Inkplate config snippet is not self-contained
because the lambda in the display example references id(my_font) without
defining that font anywhere. Update the example in inkplate.mdx so it either
includes a matching font block in the minimal configuration or changes the
lambda to use only primitives that require no extra setup, keeping the snippet
copy/paste-valid.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 78e52534-1dce-44de-9d7b-40d3470b1d28
📒 Files selected for processing (1)
src/content/docs/components/display/inkplate.mdx
| ```yaml | ||
| # Example minimal configuration entry | ||
| i2c: | ||
|
|
||
| mcp23017: | ||
| - id: mcp23017_hub | ||
| pca6416a: | ||
| - id: pca6416a_hub | ||
| address: 0x20 | ||
|
|
||
| display: | ||
| - platform: inkplate | ||
| id: inkplate_display | ||
| greyscale: false | ||
| partial_updating: false | ||
| update_interval: 60s | ||
| model: inkplate_6 | ||
|
|
||
| ckv_pin: 32 | ||
| sph_pin: 33 | ||
| gmod_pin: | ||
| mcp23xxx: mcp23017_hub | ||
| number: 1 | ||
| gpio0_enable_pin: | ||
| mcp23xxx: mcp23017_hub | ||
| number: 8 | ||
| oe_pin: | ||
| mcp23xxx: mcp23017_hub | ||
| number: 0 | ||
| spv_pin: | ||
| mcp23xxx: mcp23017_hub | ||
| number: 2 | ||
| powerup_pin: | ||
| mcp23xxx: mcp23017_hub | ||
| number: 4 | ||
| wakeup_pin: | ||
| mcp23xxx: mcp23017_hub | ||
| number: 3 | ||
| vcom_pin: | ||
| mcp23xxx: mcp23017_hub | ||
| number: 5 | ||
| - platform: inkplate | ||
| model: inkplate6v2 | ||
| pca6416a_id: pca6416a_hub | ||
| update_interval: 60s | ||
| lambda: |- | ||
| it.print(0, 0, id(my_font), "Hello World!"); | ||
| ``` |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Make the minimal config snippet self-contained.
Line 52 uses id(my_font), but this example never defines that font. Because this block is labeled "Minimal Configuration", copy/paste users will hit an unresolved-ID validation error. Either add a matching font: block or switch the lambda to primitives that need no extra setup.
Suggested doc fix
display:
- platform: inkplate
model: inkplate6v2
pca6416a_id: pca6416a_hub
update_interval: 60s
lambda: |-
- it.print(0, 0, id(my_font), "Hello World!");
+ it.fill(COLOR_OFF);
+ it.rectangle(10, 10, 120, 60);📝 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.
| ```yaml | |
| # Example minimal configuration entry | |
| i2c: | |
| mcp23017: | |
| - id: mcp23017_hub | |
| pca6416a: | |
| - id: pca6416a_hub | |
| address: 0x20 | |
| display: | |
| - platform: inkplate | |
| id: inkplate_display | |
| greyscale: false | |
| partial_updating: false | |
| update_interval: 60s | |
| model: inkplate_6 | |
| ckv_pin: 32 | |
| sph_pin: 33 | |
| gmod_pin: | |
| mcp23xxx: mcp23017_hub | |
| number: 1 | |
| gpio0_enable_pin: | |
| mcp23xxx: mcp23017_hub | |
| number: 8 | |
| oe_pin: | |
| mcp23xxx: mcp23017_hub | |
| number: 0 | |
| spv_pin: | |
| mcp23xxx: mcp23017_hub | |
| number: 2 | |
| powerup_pin: | |
| mcp23xxx: mcp23017_hub | |
| number: 4 | |
| wakeup_pin: | |
| mcp23xxx: mcp23017_hub | |
| number: 3 | |
| vcom_pin: | |
| mcp23xxx: mcp23017_hub | |
| number: 5 | |
| - platform: inkplate | |
| model: inkplate6v2 | |
| pca6416a_id: pca6416a_hub | |
| update_interval: 60s | |
| lambda: |- | |
| it.print(0, 0, id(my_font), "Hello World!"); | |
| ``` |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/content/docs/components/display/inkplate.mdx` around lines 39 - 53, The
minimal Inkplate config snippet is not self-contained because the lambda in the
display example references id(my_font) without defining that font anywhere.
Update the example in inkplate.mdx so it either includes a matching font block
in the minimal configuration or changes the lambda to use only primitives that
require no extra setup, keeping the snippet copy/paste-valid.
| ```yaml | ||
| display: | ||
| - platform: inkplate | ||
| id: inkplate_display | ||
| greyscale: true | ||
| partial_updating: false | ||
| update_interval: never | ||
| model: inkplate_10 | ||
|
|
||
| ckv_pin: 32 | ||
| sph_pin: 33 | ||
| gmod_pin: | ||
| pca6416a: pca6416a_hub | ||
| number: 1 | ||
| gpio0_enable_pin: | ||
| pca6416a: pca6416a_hub | ||
| number: 8 | ||
| oe_pin: | ||
| pca6416a: pca6416a_hub | ||
| number: 0 | ||
| spv_pin: | ||
| pca6416a: pca6416a_hub | ||
| number: 2 | ||
| powerup_pin: | ||
| pca6416a: pca6416a_hub | ||
| number: 4 | ||
| wakeup_pin: | ||
| pca6416a: pca6416a_hub | ||
| number: 3 | ||
| vcom_pin: | ||
| pca6416a: pca6416a_hub | ||
| number: 5 | ||
| model: inkplate6v2 | ||
| pca6416a_id: pca6416a_hub | ||
| full_update_every: 10 | ||
| update_interval: 5s | ||
| lambda: |- | ||
| it.fill(COLOR_OFF); | ||
| it.strftime(400, 300, id(roboto_48), COLOR_ON, TextAlign::CENTER, "%H:%M:%S", id(esptime).now()); | ||
| ``` |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
The partial-update example references undeclared IDs.
Line 296 uses id(esptime), which is never defined anywhere on this page, and id(roboto_48) only exists in a different snippet. As written, this block cannot be used independently and will fail validation unless readers infer missing setup.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/content/docs/components/display/inkplate.mdx` around lines 287 - 297, The
Inkplate partial-update example in the display block references IDs that are not
defined in the same snippet, so it is not self-contained. Update the example to
either define the required entities in this page’s snippet or replace the
references in the lambda so it only uses symbols introduced here, specifically
the lambda, id(esptime), and id(roboto_48). Make sure the displayed
configuration can be validated on its own without relying on earlier examples.
Description
Update docs for Inkplate refactor
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
/src/content/docs/components/index.mdxwhen creating new documents for new components or cookbook.New Component Images
If you are adding a new component to ESPHome, you can automatically generate a standardized black and white component name image for the documentation.
To generate a component image:
Comment on this pull request with the following command, replacing
component_namewith your component name in lower_case format with underscores (e.g.,bme280,sht3x,dallas_temp):The ESPHome bot will respond with a downloadable ZIP file containing the SVG image.
Extract the SVG file and place it in the
/public/images/folder of this repository.Use the image in your component's index table entry in
/src/content/docs/components/index.mdx.Example: For a component called "DHT22 Temperature Sensor", use:
Note: All images used in ImgTable components must be placed in
/public/images/as the component resolves them to absolute paths.