FlushResult Renamed to UARTFlushResult
The FlushResult enum introduced in ESPHome 2026.3.0 has been renamed to UARTFlushResult with prefixed enum values to follow ESPHome’s naming conventions and avoid macro collisions.
This is a breaking change for external components in ESPHome 2026.4.0 and later.
Background
Section titled “Background”PR #15101: Rename FlushResult to UARTFlushResult with UART_FLUSH_RESULT_ prefix
The original FlushResult::SUCCESS value collided with the Realtek RTL SDK’s #define SUCCESS 0 macro, requiring ugly #pragma push_macro workarounds. Renaming to UARTFlushResult with UART_FLUSH_RESULT_ prefixed values follows ESPHome’s conventional component-prefix naming style (matching UARTParityOptions / UART_CONFIG_PARITY_NONE) and eliminates the collision entirely.
What’s Changing
Section titled “What’s Changing”| Before | After |
|---|---|
FlushResult | UARTFlushResult |
FlushResult::SUCCESS | UARTFlushResult::UART_FLUSH_RESULT_SUCCESS |
FlushResult::TIMEOUT | UARTFlushResult::UART_FLUSH_RESULT_TIMEOUT |
FlushResult::FAILED | UARTFlushResult::UART_FLUSH_RESULT_FAILED |
FlushResult::ASSUMED_SUCCESS | UARTFlushResult::UART_FLUSH_RESULT_ASSUMED_SUCCESS |
Who This Affects
Section titled “Who This Affects”External components that implement UARTComponent::flush() and reference the FlushResult type or enum values.
This only affects components updated for the 2026.3.0 flush() return type change. If you haven’t updated your flush() override yet, see the 2026.3.0 UART flush blog post first.
Migration Guide
Section titled “Migration Guide”// Before (2026.3.0)FlushResult flush() override { // ... return FlushResult::ASSUMED_SUCCESS;}
// After (2026.4.0)UARTFlushResult flush() override { // ... return UARTFlushResult::UART_FLUSH_RESULT_ASSUMED_SUCCESS;}Supporting Multiple ESPHome Versions
Section titled “Supporting Multiple ESPHome Versions”#if ESPHOME_VERSION_CODE >= VERSION_CODE(2026, 4, 0)UARTFlushResult flush() override { // ... return UARTFlushResult::UART_FLUSH_RESULT_ASSUMED_SUCCESS;}#elif ESPHOME_VERSION_CODE >= VERSION_CODE(2026, 3, 0)FlushResult flush() override { // ... return FlushResult::ASSUMED_SUCCESS;}#elsevoid flush() override { // ...}#endifTimeline
Section titled “Timeline”- ESPHome 2026.3.0 (March 2026):
FlushResultintroduced - ESPHome 2026.4.0 (April 2026): Renamed to
UARTFlushResultwith prefixed values - No deprecation period — this is a rename of a type introduced one release ago
Finding Code That Needs Updates
Section titled “Finding Code That Needs Updates”# Find FlushResult references in your componentgrep -rn 'FlushResult' 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.