Fix build error on ESPHome 2026.10 - #80
Conversation
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)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughThe ESPHome integration version changes to ChangesESPHome core update
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The release update has no identified actionable risk and is ready to merge with normal checks. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. A rabbit hops through version lines Comment |
The PR was opened on 2026-09-17 and merges on 2026-09-18. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Version: 26.9.18.1
What does this implement/fix?
The
apply_ota_sourcescript builds the manifest URL as astd::stringand hands it toset_source_url. On ESPHome dev that setter is now:Two problems follow:
cannot convert 'std::string' to 'const char*'..c_str()on the localstd::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_urlstill takes astd::string, andconst char *converts implicitly. Nomin_versionchange, and both CI legs stay green.Worth noting that CI would not have caught this.
ci.ymlbuilds againststableandbetaonly; thedevleg is commented out.Types of changes
Checklist / Checklijst:
If user-visible functionality or configuration variables are added/modified:
🤖 Generated with Claude Code
Summary by CodeRabbit