Skip to content

Allow passing ESPHome ports by name#48

Merged
puddly merged 11 commits intodevfrom
puddly/esphome-mandatory-name
Apr 6, 2026
Merged

Allow passing ESPHome ports by name#48
puddly merged 11 commits intodevfrom
puddly/esphome-mandatory-name

Conversation

@puddly
Copy link
Copy Markdown
Owner

@puddly puddly commented Apr 5, 2026

Instead of using ESPHome serial proxy port instance IDs to refer to ports, we should use the user-friendly name. I've taken this opportunity to clean up the URI format.

Before:

esphome://my-device.local/0

After:

esphome://my-device.local?port_name=Some+Name

Python code that knows it's directly communicating with an ESPHome device should instead pass these as kwargs to either Serial.from_url (sync) or open_serial_connection (async) to avoid dealing with URI encoding.

The old format is still supported for convenience. In addition, we now support passing an external aioesphomeapi instance, which allows for creating and tearing down serial connections without opening a new API connection to a device.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.82%. Comparing base (d2f03b5) to head (84fa531).
⚠️ Report is 1 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev      #48      +/-   ##
==========================================
+ Coverage   88.69%   88.82%   +0.13%     
==========================================
  Files          19       19              
  Lines        2734     2757      +23     
==========================================
+ Hits         2425     2449      +24     
+ Misses        309      308       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@puddly puddly merged commit ab1214f into dev Apr 6, 2026
38 checks passed
@puddly puddly deleted the puddly/esphome-mandatory-name branch April 6, 2026 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant