Skip to content

Fix build error on ESPHome 2026.10 - #80

Merged
bharvey88 merged 2 commits into
betafrom
fix/ota-manifest-source-url
Sep 18, 2026
Merged

bharvey88 merged 2 commits into
betafrom
fix/ota-manifest-source-url

Conversation

@bharvey88

@bharvey88 bharvey88 commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Version: 26.9.18.1

What does this implement/fix?

The apply_ota_source script builds the manifest URL as a std::string and hands it to set_source_url. On ESPHome dev that setter is now:

void set_source_url(const char *source_url) { this->source_url_ = source_url; }

Two problems follow:

  • The build fails on the next ESPHome release: cannot convert 'std::string' to 'const char*'.
  • The obvious fix, .c_str() on the local std::string, would compile and then fail at runtime. The setter stores the pointer without copying, and the local string is destroyed when the lambda returns, so the update component would be left holding a dangling pointer.

This selects between two string literals instead. Literals have static storage duration, so the stored pointer stays valid for the life of the device.

Backward compatible: on 2026.8.x set_source_url still takes a std::string, and const char * converts implicitly. No min_version change, and both CI legs stay green.

Worth noting that CI would not have caught this. ci.yml builds against stable and beta only; the dev leg is commented out.

Types of changes

  • Bugfix (fixed change that fixes an issue)
  • New feature (thanks!)
  • Breaking change (repair/feature that breaks existing functionality)
  • Dependency Update - Does not publish
  • Other - Does not publish
  • Website of github readme file update - Does not publish
  • Github workflows - Does not publish

Checklist / Checklijst:

  • The code change has been tested and works locally
  • The code change has not yet been tested

If user-visible functionality or configuration variables are added/modified:

  • Added/updated documentation for the web page

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Updates
    • Updated the ESPHome integration version to 26.9.18.1.
    • Existing OTA source URL construction remains unchanged.
    • OTA source logging continues to operate as before.
    • No other user-visible integration behavior changes are included in this update.

ESPHome dev changed http_request update's setter to
set_source_url(const char *), and it stores the pointer without
copying. The current lambda builds a std::string, which no longer
compiles, and adding .c_str() to a local std::string would leave the
component holding a dangling pointer once the lambda returns.

Select between two string literals instead. Literals have static
storage duration, so the stored pointer stays valid for the life of the
device. This also builds on 2026.8.x, where the setter still takes a
std::string and const char * converts implicitly, so no min_version
change is needed.

Version: 26.9.17.1

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@bharvey88 bharvey88 added the bugfix Something isn't working label Sep 17, 2026
@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 3e75cc78-2e99-4d92-879c-9b62faecdd66

📥 Commits

Reviewing files that changed from the base of the PR and between 88b0125 and 142dbc0.

📒 Files selected for processing (1)
  • Integrations/ESPHome/Core.yaml

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

The ESPHome integration version changes to 26.9.18.1. The OTA source script now stores the selected URL as a const char * and passes it directly to logging and source configuration.

Changes

ESPHome core update

Layer / File(s) Summary
Version and OTA source update
Integrations/ESPHome/Core.yaml
The version changes from 26.9.17.1 to 26.9.18.1. The OTA source URL changes from std::string to const char *, and calls no longer use .c_str().

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: bunton33

Merge Risk: ⚪ Minimal · up to 142db

The release update has no identified actionable risk and is ready to merge with normal checks.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: fixing an ESPHome 2026.10 build error through an apply_ota_source compatibility update.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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

A rabbit hops through version lines
The OTA URL now shines
No string wrapper slows its way
Logs and source receive it straight
Core.yaml marks the new release cheerfully

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

The PR was opened on 2026-09-17 and merges on 2026-09-18.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@bharvey88 bharvey88 changed the title Pass a string literal to set_source_url in apply_ota_source Fix build error on ESPHome 2026.10 Sep 18, 2026
@bharvey88
bharvey88 merged commit 991728d into beta Sep 18, 2026
8 checks passed
@bharvey88
bharvey88 deleted the fix/ota-manifest-source-url branch September 18, 2026 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant