Skip to content

Custom URI handler registration#62

Merged
puddly merged 10 commits intodevfrom
puddly/custom-protocol-handlers
Apr 17, 2026
Merged

Custom URI handler registration#62
puddly merged 10 commits intodevfrom
puddly/custom-protocol-handlers

Conversation

@puddly
Copy link
Copy Markdown
Owner

@puddly puddly commented Apr 16, 2026

This PR adds serialx.register_uri_handler, our new system of registering platforms. For example:

serialx.register_uri_handler(
    scheme="device://",
    unique_scheme="linux://",
    sync_cls=LinuxSerial,
    async_transport_cls=LinuxSerialTransport,
    list_serial_ports_func=linux_list_serial_ports,
    weight=3,
    strip_uri_scheme=True,
)

This will be used in the future to allow Home Assistant to register its own esphome-hass:// URI scheme to centralize ESPHome API connections within Core and to keep encryption keys out of integration config.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

Codecov Report

❌ Patch coverage is 96.11650% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.86%. Comparing base (6109b77) to head (4ca2a79).
⚠️ Report is 1 commits behind head on dev.

Files with missing lines Patch % Lines
serialx/platforms/serial_esphome.py 66.66% 1 Missing ⚠️
serialx/platforms/serial_freebsd.py 75.00% 1 Missing ⚠️
serialx/platforms/serial_rfc2217/__init__.py 66.66% 1 Missing ⚠️
serialx/platforms/serial_socket.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev      #62      +/-   ##
==========================================
+ Coverage   89.67%   89.86%   +0.19%     
==========================================
  Files          19       19              
  Lines        2953     3010      +57     
==========================================
+ Hits         2648     2705      +57     
  Misses        305      305              

☔ 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.

Comment thread serialx/platforms/serial_posix.py
Comment thread serialx/platforms/serial_win32.py
@puddly puddly merged commit 95b5860 into dev Apr 17, 2026
38 checks passed
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.

2 participants