Repository navigation
Add __repr__ to the sync serial port - #156
Merged
Merged
Conversation
Happyfield7
force-pushed
the
add-serial-repr
branch
from
November 20, 2026 17:45
91bda81 to
643db5e
Compare
puddly
enabled auto-merge (squash)
November 20, 2026 17:46
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #156 +/- ##
==========================================
+ Coverage 94.36% 94.38% +0.02%
==========================================
Files 25 25
Lines 4433 4437 +4
==========================================
+ Hits 4183 4188 +5
+ Misses 250 249 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Problem
AsyncSerialhas a readablerepr(), but the sync port shows only<serialx.platforms.serial_linux.LinuxSerial object at 0x...>, so logs and debugger output do not say which port it is or whether it is open.Change
BaseSerial.__repr__returns<LinuxSerial path='/dev/ttyUSB0' baudrate=115200 open=True>. The path goes throughredact_uri(), likeAsyncSerial.__repr__, so ESPHome keys are not shown.PyodideSerial.is_opennow returnsFalseinstead of raising, because the transport only uses that class to hold settings andrepr()readsis_open.Testing
Unit tests cover an unopened port, secret redaction and the Pyodide class; a pair test checks
open=across open and close on every backend. Full suite passes on macOS and Debian sid.