remote_base RemoteReceiveData Views the Frame Through a Span
RemoteReceiveData now views a received frame through a std::span, so a receiver can hand frames to listeners and
dumpers straight from its own capture buffer. get_raw_data() returns that span instead of a reference to a vector.
External components that read get_raw_data() as a vector need a small change.
This is a developer breaking change for external components in ESPHome 2026.12.0 and later.
Background
Section titled “Background”PR #22269: Dispatch received frames from a span
Every receiver had to copy each frame into the base class temp_ vector before listeners and dumpers could see it.
A receiver with its own capture buffer, such as the BK72xx timer-sampled receiver, then needed a second buffer the
size of the largest frame just for that copy. With the frame viewed through a span, the receiver dispatches its own
buffer directly.
What’s Changing
Section titled “What’s Changing”RemoteReceiveData::get_raw_data()returnsremote_base::RawTimingsView(std::span<const int32_t>) instead ofconst remote_base::RawTimings &.RemoteReceiverBasegainscall_listeners_dumpers_(RawTimingsView)for a receiver that dispatches its own buffer. The existingcall_listeners_dumpers_()still dispatchestemp_.
Who This Affects
Section titled “Who This Affects”External components that:
- bind the result of
get_raw_data()toauto &or to astd::vectorreference - pass it to a function taking
const std::vector<int32_t> & - call vector-only members on it, such as
at()
YAML configurations and on_raw lambdas are not affected: x in on_raw is still a std::vector<int32_t>.
Migration Guide
Section titled “Migration Guide”// Beforeconst remote_base::RawTimings &timings = data.get_raw_data();// After: view the frameremote_base::RawTimingsView timings = data.get_raw_data();// After: keep a copyauto view = data.get_raw_data();remote_base::RawTimings timings(view.begin(), view.end());A helper that took const RawTimings & can take RawTimingsView instead; a vector still converts to it.
Supporting Multiple ESPHome Versions
Section titled “Supporting Multiple ESPHome Versions”auto timings = data.get_raw_data(); compiles on both, as a copy of the vector before 2026.12.0 and a span from
2026.12.0. Indexing, size(), empty() and range-for work on both.
Timeline
Section titled “Timeline”- ESPHome 2026.12.0 (December 2026):
get_raw_data()returns a span. No deprecation period: a return type cannot be overloaded.
Finding Code That Needs Updates
Section titled “Finding Code That Needs Updates”grep -rn 'get_raw_data()' your_component/Questions?
Section titled “Questions?”If you have questions about migrating your external component, please ask in:
- ESPHome Discord - #devs channel
- ESPHome GitHub Discussions
Related Documentation
Section titled “Related Documentation”Copyright © 2026 ESPHome - A project from the Open Home Foundation
Comments
Feel free to leave a comment here to discuss this post with others. You can ask questions, share your experience, or suggest improvements. If you have a question about a specific feature or issue, please consider using the ESPHome Discord. Stick to English and follow ESPHome's code of conduct. These comments exist on a discussion on GitHub, so you can also comment there directly if you prefer.