Skip to content

Conversation

andrewjswan
Copy link
Contributor

Description:

Mapping: Fix typo

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 /components/index.rst 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 UPPER_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 images/ folder of this repository.

  4. Use the image in your component's index table entry in /components/index.rst.

Example: For a component called "DHT22 Temperature Sensor", use:

@esphomebot generate image DHT22

@esphome esphome bot added the current label Sep 17, 2025
Copy link

netlify bot commented Sep 17, 2025

Deploy Preview for esphome ready!

Name Link
🔨 Latest commit 710d1d2
🔍 Latest deploy log https://app.netlify.com/projects/esphome/deploys/68cabdea63998d0008f19f0c
😎 Deploy Preview https://deploy-preview-5375--esphome.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

Copy link
Contributor

coderabbitai bot commented Sep 17, 2025

Walkthrough

Fixes a syntax error in a code snippet within documentation: removes an extra closing bracket in a mapping example. No functional code changes, tests, or public API modifications.

Changes

Cohort / File(s) Summary
Documentation
content/components/mapping.md
Corrected snippet from auto color = color_map.get(random_uint32() % 3]); to auto color = color_map.get(random_uint32() % 3);

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested labels

current

Suggested reviewers

  • kbx81
  • frenck

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title "Mapping: Fix typo" concisely and accurately describes the primary change in this PR, which the raw_summary shows is a single-line correction in the Mapping component documentation (removal of an extra bracket). It is short, specific to the changeset, and suitable for a teammate scanning history.
Description Check ✅ Passed The PR description states this is a documentation typo fix for Mapping and includes contextual checklist items, which matches the raw_summary showing a documentation-only one-line correction. The description is on-topic and related to the changeset.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 979f00e and 710d1d2.

📒 Files selected for processing (1)
  • content/components/mapping.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

  • Do not generate or add any sequence diagrams

Files:

  • content/components/mapping.md
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
PR: esphome/esphome-docs#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-24T00:13:13.459Z
Learning: Open pull requests against the correct base branch: use `current` for documentation-only revisions and `next` for changes tied to new features in esphome/esphome
🔇 Additional comments (1)
content/components/mapping.md (1)

92-92: Replace '#' with '//' inside C++ lambda; mapping access clarification (content/components/mapping.md: line 92)

  • '#' inside a YAML block scalar is included verbatim in the generated C++ (not a YAML comment) and will produce an invalid preprocessor line — use '//' or /* ... */ instead. (yaml.info)
  • Mappings can be accessed with color_map[index] or id(color_map)[index]; get()/set() are also available — the claim that color_map.get(...) "will not resolve" is incorrect. (next.esphome.io)

Likely an incorrect or invalid review comment.

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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 and usage tips.

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.

1 participant