Skip to content

Add serialx.is_non_unique_serial - #143

Merged
puddly merged 8 commits into
devfrom
puddly/bad-serial-numbers
Oct 22, 2026
Merged

puddly merged 8 commits into
devfrom
puddly/bad-serial-numbers

Conversation

@puddly

@puddly puddly commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Adds serialx.is_non_unique_serial. This allows downstream code to better deal with non-unique serial numbers (i.e. clones or early device variants) without building its own small database of bad serial numbers.

@codecov

codecov Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.31%. Comparing base (d8bd287) to head (9cbd112).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #143   +/-   ##
=======================================
  Coverage   94.30%   94.31%           
=======================================
  Files          25       25           
  Lines        4391     4397    +6     
=======================================
+ Hits         4141     4147    +6     
  Misses        250      250           

☔ View full report in Codecov by Harness.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@puddly
puddly marked this pull request as ready for review October 21, 2026 15:10
@puddly
puddly requested a balanced review from Copilot October 21, 2026 15:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Missing Windows-suffixed FTDI aliases cause known shared serial numbers to be classified as unique.

1 open issue
What changed in this PR

Adds SerialPortInfo.is_unique so downstream code can recognize known shared serial numbers without maintaining its own list.

Changes:

  • Classifies missing, blank, and known shared serial numbers as non-unique.
  • Keeps ESPHome device URLs tied to a port when serial numbers are non-unique.
  • Adds classification and ESPHome clone coverage.
File Description
tests/​test_serial_esphome.py Adds a shared-serial device listing case.
tests/​test_common.py Tests serial-number uniqueness classification.
serialx/​platforms/​serial_esphome.py Uses uniqueness to determine port binding.
serialx/​common.py Adds known shared serials and is_unique.

Review effort: Balanced

Comment thread serialx/common.py Outdated
@puddly puddly changed the title Add is_unique to SerialPortInfo Add serialx.is_non_unique_serial Oct 21, 2026
@puddly
puddly merged commit e154f2b into dev Oct 22, 2026
31 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