Subscribe to aioesphomeapi close events - #112
Merged
Merged
Conversation
balloob
reviewed
Aug 23, 2026
balloob
reviewed
Aug 23, 2026
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #112 +/- ##
==========================================
+ Coverage 92.47% 92.53% +0.06%
==========================================
Files 22 22
Lines 3747 3819 +72
==========================================
+ Hits 3465 3534 +69
- Misses 282 285 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
Normal teardown leaks an ESPHome close callback, and an unrelated public API signature change breaks positional callers.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds ESPHome API disconnect detection and propagates connection loss through serial transports.
Changes:
- Upgrades
aioesphomeapito 46.0.0. - Subscribes sync and async ESPHome transports to connection-close events.
- Expands disconnect and lifecycle test coverage.
File summaries
| File | Description |
|---|---|
serialx/platforms/serial_esphome.py |
Handles API connection-close events. |
serialx/async_serial.py |
Changes connection function signature. |
tests/test_serial_esphome.py |
Tests disconnect propagation. |
tests/test_async_transports.py |
Adds ESPHome close quirk handling. |
tests/test_async_lifecycle.py |
Adjusts lifecycle test reliability. |
tests/conftest.py |
Configures ESPHome fixtures and timezone warmup. |
tests/common.py |
Extends pair metadata and ESPHome unplug support. |
pyproject.toml |
Raises the ESPHome API dependency minimum. |
uv.lock |
Locks updated dependency versions. |
Review details
- Files reviewed: 8/9 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
puddly
marked this pull request as ready for review
August 24, 2026 14:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ESPHome serial proxies currently have an API gap: we do not know when API connections are no longer connected.
Requires esphome/aioesphomeapi#1853.