Skip to content

Conversation

pzich
Copy link
Contributor

@pzich pzich commented Sep 17, 2025

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

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

@esphome esphome bot added the current label Sep 17, 2025
@pzich pzich force-pushed the pzich/fix-api-refs branch from bfed8db to 95f9131 Compare September 17, 2025 03:59
Copy link

netlify bot commented Sep 17, 2025

Deploy Preview for esphome ready!

Name Link
🔨 Latest commit bfed8db
🔍 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.

Copy link
Contributor

coderabbitai bot commented Sep 17, 2025

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

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.

Copy link

netlify bot commented Sep 17, 2025

Deploy Preview for esphome ready!

Name Link
🔨 Latest commit 04200d9
🔍 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (7)
content/components/ota/_index.md (1)

164-164: ota_backend.h reference looks correct

Minor nit: consider a human‑readable link label (e.g., “C++ API: ota_backend.h”) instead of repeating the path for better UX.

Apply if desired:

-{{< apiref "ota/ota_backend.h" "ota/ota_backend.h" >}}
+{{< apiref "ota/ota_backend.h" "C++ API: ota_backend.h" >}}
content/components/output/sm2235.md (1)

135-135: Use a human‑readable link label for apiref.

The first apiref argument is shown to readers; avoid exposing the header path.

Apply:

-{{< apiref "sm2235/sm2235.h" "sm2235/sm2235.h" >}}
+{{< apiref "API Reference (SM2235)" "sm2235/sm2235.h" >}}
content/components/ota/web_server.md (1)

121-121: Prefer a readable label instead of the header path.

-{{< apiref "web_server/ota/ota_web_server.h" "web_server/ota/ota_web_server.h" >}}
+{{< apiref "API Reference (Web Server OTA)" "web_server/ota/ota_web_server.h" >}}
content/components/light/esp32_rmt_led_strip.md (1)

95-95: Align apiref label style with the rest of the docs.

-{{< apiref "esp32_rmt_led_strip/led_strip.h" "esp32_rmt_led_strip/led_strip.h" >}}
+{{< apiref "API Reference (ESP32 RMT LED Strip)" "esp32_rmt_led_strip/led_strip.h" >}}
content/components/weikai.md (1)

299-299: Readable apiref label.

-{{< apiref "weikai/weikai.h" "weikai/weikai.h" >}}
+{{< apiref "API Reference (WeiKai)" "weikai/weikai.h" >}}
content/components/light/hbridge.md (1)

48-48: Readable apiref label.

-{{< apiref "hbridge/light/hbridge_light_output.h" "hbridge/light/hbridge_light_output.h" >}}
+{{< apiref "API Reference (H‑bridge Light)" "hbridge/light/hbridge_light_output.h" >}}
content/components/ota/esphome.md (1)

89-89: Readable apiref label.

-{{< apiref "esphome/ota/ota_esphome.h" "esphome/ota/ota_esphome.h" >}}
+{{< apiref "API Reference (ESPHome OTA)" "esphome/ota/ota_esphome.h" >}}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6aa8434 and 95f9131.

📒 Files selected for processing (33)
  • content/components/binary_sensor/ble_presence.md (1 hunks)
  • content/components/button/factory_reset.md (1 hunks)
  • content/components/climate/bedjet.md (1 hunks)
  • content/components/climate/midea.md (1 hunks)
  • content/components/display/pcd8544.md (1 hunks)
  • content/components/display/st7567.md (1 hunks)
  • content/components/display/st7789v.md (1 hunks)
  • content/components/espnow.md (1 hunks)
  • content/components/light/beken_spi_led_strip.md (1 hunks)
  • content/components/light/esp32_rmt_led_strip.md (1 hunks)
  • content/components/light/hbridge.md (1 hunks)
  • content/components/mcp23Sxx.md (1 hunks)
  • content/components/ota/_index.md (1 hunks)
  • content/components/ota/esphome.md (1 hunks)
  • content/components/ota/http_request.md (1 hunks)
  • content/components/ota/web_server.md (1 hunks)
  • content/components/output/sm16716.md (1 hunks)
  • content/components/output/sm2135.md (1 hunks)
  • content/components/output/sm2235.md (1 hunks)
  • content/components/sensor/ade7953.md (1 hunks)
  • content/components/sensor/am43.md (1 hunks)
  • content/components/sensor/bme280.md (1 hunks)
  • content/components/sensor/bmp280.md (1 hunks)
  • content/components/sensor/ens160.md (1 hunks)
  • content/components/sensor/ens210.md (1 hunks)
  • content/components/sensor/max31856.md (1 hunks)
  • content/components/sensor/sdm_meter.md (1 hunks)
  • content/components/sensor/uptime.md (1 hunks)
  • content/components/sn74hc165.md (1 hunks)
  • content/components/tca9555.md (1 hunks)
  • content/components/touchscreen/axs15231.md (1 hunks)
  • content/components/touchscreen/gt911.md (1 hunks)
  • content/components/weikai.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

  • Do not generate or add any sequence diagrams

Files:

  • content/components/tca9555.md
  • content/components/sn74hc165.md
  • content/components/ota/http_request.md
  • content/components/binary_sensor/ble_presence.md
  • content/components/ota/esphome.md
  • content/components/espnow.md
  • content/components/ota/web_server.md
  • content/components/light/hbridge.md
  • content/components/mcp23Sxx.md
  • content/components/output/sm2135.md
  • content/components/output/sm2235.md
  • content/components/sensor/bme280.md
  • content/components/touchscreen/gt911.md
  • content/components/display/st7567.md
  • content/components/sensor/uptime.md
  • content/components/sensor/ens210.md
  • content/components/button/factory_reset.md
  • content/components/display/st7789v.md
  • content/components/touchscreen/axs15231.md
  • content/components/light/esp32_rmt_led_strip.md
  • content/components/sensor/max31856.md
  • content/components/sensor/sdm_meter.md
  • content/components/sensor/am43.md
  • content/components/climate/midea.md
  • content/components/display/pcd8544.md
  • content/components/sensor/ens160.md
  • content/components/sensor/bmp280.md
  • content/components/sensor/ade7953.md
  • content/components/output/sm16716.md
  • content/components/weikai.md
  • content/components/ota/_index.md
  • content/components/light/beken_spi_led_strip.md
  • content/components/climate/bedjet.md
🔇 Additional comments (26)
content/components/sensor/bmp280.md (1)

95-95: Correct switch to bmp280_base header

Matches current structure; proceed after header existence check (see script in sm2135.md comment).

content/components/climate/bedjet.md (1)

214-214: bedjet_hub.h target looks right

Good change; ensure Doxygen generates this symbol on the docs ref used by “current”. Covered by the verification script.

content/components/output/sm16716.md (1)

219-219: apiref now points to sm16716/sm16716.h — OK

Consistent with other output components. Verify via the shared script.

content/components/sensor/ens160.md (1)

110-110: Move to ens160_base header — OK

Base header reference aligns with recent reorganizations. Validate presence via the shared script.

content/components/sensor/am43.md (1)

67-67: apiref retarget to am43_base.h — looks good

Consistent with base split. Validate with the shared script.

content/components/binary_sensor/ble_presence.md (1)

139-139: Device‑specific header reference LGTM

Switch to ble_presence_device.h makes sense. Covered by the verification script.

content/components/output/sm2135.md (1)

124-124: apiref path update LGTM — headers verified in esphome/esphome (REF=dev)
All listed headers in the check script were found (OK).

content/components/sensor/sdm_meter.md (1)

122-122: Approve — apiref corrected to sdm_meter/sdm_meter.h

Confirmed header exists at esphome/components/sdm_meter/sdm_meter.h.

content/components/touchscreen/gt911.md (1)

60-60: Approve — apiref relocated to esphome/components/gt911/touchscreen/gt911_touchscreen.h
Header present at esphome/components/gt911/touchscreen/gt911_touchscreen.h.

content/components/sensor/ade7953.md (1)

309-309: LGTM — apiref target is correct.
Header found at esphome/components/ade7953_base/ade7953_base.h; approve changes.

content/components/sensor/ens210.md (1)

44-44: Approve — apiref lowercased to esphome/components/ens210/ens210.h is correct.
Header found at esphome/components/ens210/ens210.h; no changes required.

content/components/espnow.md (1)

217-217: Approve — apiref updated to espnow_component.h. Confirmed file exists at esphome/components/espnow/espnow_component.h.

content/components/display/st7567.md (1)

175-175: Approve — apiref updated to st7567_base (verified).
Header exists at esphome/components/st7567_base/st7567_base.h.

content/components/sensor/bme280.md (1)

102-102: Apiref now points to bme280_base — OK.
Verified header exists at esphome/components/bme280_base/bme280_base.h.

content/components/climate/midea.md (1)

286-286: Approve — apiref switched to midea/air_conditioner.h (verify header exists)
GH API rate-limited and local repo search returned no match for esphome/components/midea/air_conditioner.h; confirm that header exists at esphome/components/midea/air_conditioner.h or update the apiref.

content/components/sn74hc165.md (1)

63-63: LGTM: normalized to lowercase path.

Matches folder/file casing used elsewhere.

content/components/display/st7789v.md (1)

309-309: LGTM: apiref updated to concrete driver header.

Change aligns with component-level header convention.

content/components/sensor/max31856.md (1)

55-55: LGTM: lowercase header path.

Consistent with other sensor headers.

content/components/touchscreen/axs15231.md (1)

32-32: LGTM: link now targets touchscreen-specific header.

Matches expected subdirectory structure.

content/components/button/factory_reset.md (1)

46-46: LGTM: path reflects new button/ subdirectory.

Included in the link-check script noted in pcd8544.md.

content/components/tca9555.md (1)

57-57: LGTM: corrected to lowercase tca9555/tca9555.h.

Consistent with I/O expander docs.

content/components/ota/http_request.md (1)

112-112: LGTM: apiref targets backend-specific header.

Covered by the verification script provided earlier.

content/components/display/pcd8544.md (1)

63-63: LGTM — apiref points to the correct header variant; automated verification failed

Ran the provided gh search script; it exited with "/bin/bash: line 10: /dev/fd/63: No such file or directory" and produced no output, so I cannot confirm the referenced headers exist in esphome/esphome. Re-run the check locally or attach the gh search output for confirmation.

content/components/mcp23Sxx.md (1)

146-147: LGTM — paths normalized and labels clear.

content/components/sensor/uptime.md (1)

37-39: Split apiref links look good — verification failed; confirm referenced headers exist

Verification couldn't complete: the verification script returned "gh: Not Found (HTTP 404)". Confirm these files exist under esphome/components:

  • uptime/sensor/uptime_seconds_sensor.h
  • uptime/sensor/uptime_timestamp_sensor.h
  • uptime/text_sensor/uptime_text_sensor.h

Re-run the verification script and paste the command output.

content/components/light/beken_spi_led_strip.md (1)

58-59: Remove orphaned plaintext header path; fix See Also apiref

GitHub code search returned 0 matches for "beken_spi_led_strip/led_strip.h" and "beken_spi_led_strip/beken_spi_led_strip.h" — in content/components/light/beken_spi_led_strip.md (lines 58–59) remove the orphaned plaintext line and either correct or remove the {{< apiref "beken_spi_led_strip/led_strip.h" "beken_spi_led_strip/led_strip.h" >}} so See Also doesn't point to a missing header.

@@ -92,4 +92,4 @@ please consider adding support to the codebase and add it to the list above.

- {{< docref "/components/light" >}}
- {{< docref "/components/power_supply" >}}
- {{< apiref "esp32_rmt_led_strip/esp32_rmt_led_strip.h" "esp32_rmt_led_strip/esp32_rmt_led_strip.h" >}}
- {{< apiref "esp32_rmt_led_strip/led_strip.h" "esp32_rmt_led_strip/led_strip.h" >}}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, something still seems to be going wrong with apiref

In this case, the resulting URL is

https://api-docs.esphome.io/led__strip_8h (just led_strip.h)

instead of

https://api-docs.esphome.io/esp32__rmt__led__strip_2led__strip_8h (esp32_rmt_led_strip/led_strip.h)

@pzich
Copy link
Contributor Author

pzich commented Sep 18, 2025

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

@pzich pzich marked this pull request as draft September 18, 2025 19:32
@pzich pzich force-pushed the pzich/fix-api-refs branch 2 times, most recently from f5c4d6f to 8605988 Compare September 19, 2025 09:37
@pzich pzich force-pushed the pzich/fix-api-refs branch from 8605988 to f2f7936 Compare September 19, 2025 09:58
@pzich pzich marked this pull request as ready for review September 19, 2025 22:44
Copy link

@esphome esphome bot left a 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.

@esphome esphome bot marked this pull request as draft September 19, 2025 22:47
@esphome
Copy link

esphome bot commented Sep 19, 2025

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

Learn more about our pull request process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant