Skip to content

[mipi_spi] Clarify and enhance documentation of transform option.#6828

Open
clydebarrow wants to merge 3 commits into
esphome:currentfrom
clydebarrow:mipi-spi
Open

[mipi_spi] Clarify and enhance documentation of transform option.#6828
clydebarrow wants to merge 3 commits into
esphome:currentfrom
clydebarrow:mipi-spi

Conversation

@clydebarrow

@clydebarrow clydebarrow commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Description

Update docs to discourage use of transform when rotation does the job.

Related issue (if applicable): fixes

Pull request in esphome with YAML changes (if applicable):

  • esphome/esphome#

Checklist

  • I am merging into next because this is new documentation that has a matching pull-request in esphome as linked above.
    or

  • I am merging into current because 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.mdx when 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:

  1. Comment on this pull request with the following command, replacing component_name with your component name in lower_case format with underscores (e.g., bme280, sht3x, dallas_temp):

    @esphomebot generate image component_name
    
  2. The ESPHome bot will respond with a downloadable ZIP file containing the SVG image.

  3. Extract the SVG file and place it in the /public/images/ folder of this repository.

  4. 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:

@esphomebot generate image dht22

Note: All images used in ImgTable components must be placed in /public/images/ as the component resolves them to absolute paths.

Copilot AI review requested due to automatic review settings June 23, 2026 02:20
@esphome esphome Bot added the current label Jun 23, 2026
@netlify

netlify Bot commented Jun 23, 2026

Copy link
Copy Markdown

Deploy Preview for esphome ready!

Name Link
🔨 Latest commit 87e4cbc
🔍 Latest deploy log https://app.netlify.com/projects/esphome/deploys/6a3b23b536df230008403bdb
😎 Deploy Preview https://deploy-preview-6828--esphome.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the mipi_spi display documentation to better explain when rotation is sufficient and to discourage using transform unless needed (primarily for CUSTOM models).

Changes:

  • Simplified the rotation option description to reflect that hardware rotation may be used when supported.
  • Moved/rewrote transform documentation to emphasize it’s typically only needed for CUSTOM models and axis mirroring/swapping.
  • Moved the SPI data_rate guidance from a standalone note into the data_rate option description.

Comment thread src/content/docs/components/display/mipi_spi.mdx Outdated
Comment thread src/content/docs/components/display/mipi_spi.mdx Outdated
Comment thread src/content/docs/components/display/mipi_spi.mdx
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Documentation for the mipi_spi display driver is reorganized: the rotation bullet clarifies hardware vs software rotation, the transform option is moved from the main configuration list into the Advanced options section, and the introductory sentence of the "Using the transform options" section is rewritten to reference custom displays and mirrored-image correction.

Changes

mipi_spi Display Driver Documentation

Layer / File(s) Summary
rotation, Advanced options block, and transform usage intro
src/content/docs/components/display/mipi_spi.mdx
rotation bullet now distinguishes hardware-handled vs software-fallback rotation. transform option entry is removed from the main config list and added inside the Advanced options section alongside byte_order and use_axis_flips. The data_rate explanatory text is consolidated into the option description. The "Using the transform options" intro sentence is rewritten to narrow the example to custom displays and mirrored-image correction.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and clearly summarizes the main change: clarifying and enhancing documentation of the transform option in the mipi_spi component.
Description check ✅ Passed The description is directly related to the changeset, explaining the objective to discourage transform use when rotation can accomplish the same goal, which aligns with the documented changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with 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.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
src/content/docs/components/display/mipi_spi.mdx (2)

220-220: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a comma after "for example".

The phrase "for example to correct" should have a comma: "for example, to correct for a mirrored image." This improves readability and follows standard grammar conventions.

📝 Suggested fix
-In most cases, the `rotation` option will be sufficient to orient the display correctly. However, some custom displays may require additional transformations for example to correct for a mirrored image. The `transform` option allows for these transformations to be applied in any of 8 different
+In most cases, the `rotation` option will be sufficient to orient the display correctly. However, some custom displays may require additional transformations, for example, to correct for a mirrored image. The `transform` option allows for these transformations to be applied in any of 8 different
🤖 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/mipi_spi.mdx` at line 220, In the
mipi_spi.mdx file, locate the phrase "for example to correct for a mirrored
image" within the paragraph discussing the transform option. Add a comma after
"for example" so it reads "for example, to correct for a mirrored image" to
follow standard grammar conventions and improve readability.

169-169: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider adding a subject for clarity.

The sentence "Should not be required unless using the CUSTOM model" is missing a subject. Consider rephrasing to "This should not be required unless using the CUSTOM model" or "It should not be required unless using the CUSTOM model" for improved readability.

🤖 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/mipi_spi.mdx` at line 169, In the
documentation for the transform parameter, the sentence "Should not be required
unless using the `CUSTOM` model" is missing a subject and should be rephrased
for clarity. Add a subject such as "This" or "It" at the beginning of the
sentence to make it grammatically complete and easier to read, changing it to
either "This should not be required unless using the `CUSTOM` model" or "It
should not be required unless using the `CUSTOM` model".

Source: Linters/SAST tools

🤖 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.

Nitpick comments:
In `@src/content/docs/components/display/mipi_spi.mdx`:
- Line 220: In the mipi_spi.mdx file, locate the phrase "for example to correct
for a mirrored image" within the paragraph discussing the transform option. Add
a comma after "for example" so it reads "for example, to correct for a mirrored
image" to follow standard grammar conventions and improve readability.
- Line 169: In the documentation for the transform parameter, the sentence
"Should not be required unless using the `CUSTOM` model" is missing a subject
and should be rephrased for clarity. Add a subject such as "This" or "It" at the
beginning of the sentence to make it grammatically complete and easier to read,
changing it to either "This should not be required unless using the `CUSTOM`
model" or "It should not be required unless using the `CUSTOM` model".

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 79d0ee7a-37bb-4571-a8fa-e932b2d3decc

📥 Commits

Reviewing files that changed from the base of the PR and between ef8da12 and 38702a2.

📒 Files selected for processing (1)
  • src/content/docs/components/display/mipi_spi.mdx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/mipi_spi.mdx`:
- Line 164: In the text at line 164, the phrase "single bit SPI" uses a compound
adjective that precedes a noun and must be hyphenated. Change "single bit SPI"
to "single-bit SPI" to follow standard English grammar rules for compound
adjectives that modify nouns.
- Line 167: Add a hyphen between "16" and "bit" in the phrase "16 bit color
depth" to properly format the compound adjective as "16-bit color depth" since
it precedes the noun "color depth". This grammatically correct hyphenation
should be applied wherever this phrase appears in the documentation.
🪄 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: e10d13b1-5fac-47f7-bbe2-0769ca46359d

📥 Commits

Reviewing files that changed from the base of the PR and between 38702a2 and c09ceff.

📒 Files selected for processing (1)
  • src/content/docs/components/display/mipi_spi.mdx

Comment thread src/content/docs/components/display/mipi_spi.mdx
Comment thread src/content/docs/components/display/mipi_spi.mdx
Copilot AI review requested due to automatic review settings June 24, 2026 00:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread src/content/docs/components/display/mipi_spi.mdx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants