esphome-docs icon indicating copy to clipboard operation
esphome-docs copied to clipboard

Fix broken API references

Open pzich opened this issue 3 months ago • 7 comments

Description:

Using a horrible bash script, I found a bunch of places where API Reference links lead to a 404.

Note: This fixes most of them, however there are some cases where apiref does not currently work (see thread) but these should all work after esphome/esphome#10794 and #5387 merge.

Related issue (if applicable): N/A

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

N/A

Checklist:

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

  • [x] 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.

pzich avatar Sep 17 '25 03:09 pzich

Deploy Preview for esphome ready!

Name Link
Latest commit bfed8dbfa5ce0d5f8b3cb8450238e52aafc0c9bf
Latest deploy log https://app.netlify.com/projects/esphome/deploys/68ca31adf315f90008ff77f8
Deploy Preview https://deploy-preview-5372--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.

netlify[bot] avatar Sep 17 '25 03:09 netlify[bot]

Walkthrough

Documentation-only updates adjusting apiref/See Also header paths across multiple component pages. Changes standardize header names, lowercase paths, and point to new/base/device-specific headers. One page (uptime) splits a single API reference into three discrete links. No code logic, behavior, or public API declarations were altered.

Changes

Cohort / File(s) Change Summary
OTA docs apiref retargets
content/components/ota/_index.md, content/components/ota/esphome.md, content/components/ota/http_request.md, content/components/ota/web_server.md
Updated See Also apiref headers from ota/ota_component.h to backend-specific headers (ota/ota_backend.h, esphome/ota/ota_esphome.h, http_request/ota/ota_http_request.h, web_server/ota/ota_web_server.h).
Sensor docs header updates
content/components/sensor/ade7953.md, .../sensor/am43.md, .../sensor/bme280.md, .../sensor/bmp280.md, .../sensor/ens160.md, .../sensor/ens210.md, .../sensor/max31856.md, .../sensor/sdm_meter.md
Adjusted apiref targets to new/base or normalized headers: e.g., ade7953_base/ade7953_base.h, am43/am43_base.h, bme280_base/bme280_base.h, bmp280_base/bmp280_base.h, ens160_base/ens160_base.h, ens210/ens210.h (lowercase), max31856/max31856.h (lowercase), sdm_meter/sdm_meter.h.
Uptime docs split
content/components/sensor/uptime.md
Replaced single API reference with three apiref links for Seconds, Timestamp, and Text headers under uptime/sensor/* and uptime/text_sensor/*.
Display headers retargeted
content/components/display/pcd8544.md, .../display/st7567.md, .../display/st7789v.md
Updated apiref links to pcd8544/pcd_8544.h, st7567_base/st7567_base.h, and st7789v/st7789v.h.
Light components apiref updates
content/components/light/beken_spi_led_strip.md, .../light/esp32_rmt_led_strip.md, .../light/hbridge.md
Retargeted apiref from legacy headers to beken_spi_led_strip/led_strip.h, esp32_rmt_led_strip/led_strip.h, and hbridge/light/hbridge_light_output.h.
Output drivers header updates
content/components/output/sm16716.md, .../output/sm2135.md, .../output/sm2235.md
Updated apiref from output/*_output_component.h to sm16716/sm16716.h, sm2135/sm2135.h, sm2235/sm2235.h.
Touchscreen headers retargeted
content/components/touchscreen/axs15231.md, .../touchscreen/gt911.md
See Also apiref updated to axs15231/axs15231_touchscreen.h and gt911/gt911_touchscreen.h.
Climate docs apiref updates
content/components/climate/bedjet.md, .../climate/midea.md
Changed See Also apiref to bedjet/bedjet_hub.h and midea/air_conditioner.h.
Misc components path normalization
content/components/espnow.md, content/components/binary_sensor/ble_presence.md, content/components/mcp23Sxx.md, content/components/sn74hc165.md, content/components/tca9555.md, content/components/weikai.md
Updated apiref paths: espnow/espnow_component.h, ble_presence/ble_presence_device.h, lowercase mcp23s08/mcp23s08.h and mcp23s17/mcp23s17.h, lowercase sn74hc165/sn74hc165.h, lowercase tca9555/tca9555.h, corrected weikai/weikai.h.
Button factory reset apiref path
content/components/button/factory_reset.md
apiref path changed to factory_reset/button/factory_reset_button.h.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • esphome/esphome-docs#3976 — Adjusts OTA documentation structure and references; overlaps with OTA apiref retargets in this PR.
  • esphome/esphome-docs#3983 — OTA docs updates (adds “platform: esphome”); related to OTA pages modified here.
  • esphome/esphome-docs#5217 — Edits to esp32_rmt_led_strip docs; this PR also updates its apiref header.

Suggested reviewers

  • jesserockz
  • kbx81

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title "Fix broken API references" is concise, directly reflects the main change (repairing multiple broken apiref links across documentation), and is specific enough for a reviewer to understand the primary intent without extraneous detail.
Description Check ✅ Passed The PR description describes the method (script), scope (38 broken links with most fixed), remaining issues, and target branch, and is clearly related to the documentation changes in the patch, meeting the lenient relevance requirement.
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

[!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.

coderabbitai[bot] avatar Sep 17 '25 04:09 coderabbitai[bot]

Deploy Preview for esphome ready!

Name Link
Latest commit 04200d99be512bd71cd5bbf95691db57e621a5c9
Latest deploy log https://app.netlify.com/projects/esphome/deploys/68cddcae2271f600082c7789
Deploy Preview https://deploy-preview-5372--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.

netlify[bot] avatar Sep 17 '25 04:09 netlify[bot]

Moving this to draft while discussing how best to proceed with this (thread)

pzich avatar Sep 18 '25 19:09 pzich

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks :+1:

Learn more about our pull request process.

esphome[bot] avatar Sep 19 '25 22:09 esphome[bot]

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. Thank you for your contributions.

github-actions[bot] avatar Dec 06 '25 02:12 github-actions[bot]

Can someone please look at this and help improve this? 🙂On Dec 5, 2025, at 6:16 PM, github-actions[bot] @.***> wrote:github-actions[bot] left a comment (esphome/esphome-docs#5372) There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. Thank you for your contributions.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

pzich avatar Dec 07 '25 01:12 pzich