Skip to content

Follow guidance to migrate from pyserial to serialx - #95

Open
WillCodeForCats wants to merge 6 commits into
mainfrom
serialx
Open

WillCodeForCats wants to merge 6 commits into
mainfrom
serialx

Conversation

@WillCodeForCats

@WillCodeForCats WillCodeForCats commented May 13, 2026 •

Copy link
Copy Markdown
Owner

HA dev team recommends migrating from pyserial to serialx

https://developers.home-assistant.io/blog/2026/04/27/pyserial-to-serialx/

Summary by CodeRabbit

  • Bug Fixes
    • Improved serial connection setup and timeout handling for device and network connections.
    • Improved handling of connection and port errors, including during port opening and closing.
  • Release
    • Updated the package to version 1.4.0.

@WillCodeForCats WillCodeForCats self-assigned this May 13, 2026
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The package moves serial communication from pyserial to serialx. The Docker image installs serialx, connection setup and error handling use serialx APIs, and package metadata and the changelog identify version 1.4.0.

Changes: serialx Migration

Layer / File(s) Summary
Dependency and release metadata
tekmar_packetserv/Dockerfile, tekmar_packetserv/config.json, tekmar_packetserv/CHANGELOG.md
The Docker image installs serialx instead of py3-pyserial. The package version and changelog identify version 1.4.0.
Serial connection handling
tekmar_packetserv/rootfs/usr/local/packetserv/packetserv.py
Serial connection modes use serialx.serial_for_url with the described port settings and explicitly open the selected port. Serial-thread, port-opening, and port-closing handlers also catch OSError.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: Minimal · up to 9d236

The migration installs serialx and opens each configured connection before processing packets; no actionable merge-blocking risk was identified.

Pre-merge checks: Passed 4 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Description check Inconclusive The description links the Home Assistant guidance on moving from pyserial to serialx and states the intent of the change. It does not include any of the template's review guidance items as checked-off… Add a short description of what changed in the code, such as the switch from the serial module to serialx, the new serial parameters (9600 baud, 8 data bits, no parity, one stop bit), and the added OSError handling. State whether the change…
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title states the main change: moving the integration from pyserial to serialx. The raw summary confirms the changes to packetserv.py, the Dockerfile, the version bump, and the changelog all implem…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title states the main change: moving the integration from pyserial to serialx. The raw summary confirms the changes to packetserv.py, the Dockerfile, the version bump, and the changelog all implement this migration. The title says "Follow guidance" which names the reason, but the title is specific enough that a teammate scanning history understands the primary change.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.

Full details: Description check

Explanation

The description links the Home Assistant guidance on moving from pyserial to serialx and states the intent of the change. It does not include any of the template's review guidance items as checked-off content, and it does not describe the implementation details, testing performed, or confirm that the branch is up to date with upstream. The template is mainly a set of contributor guidelines rather than fill-in sections, so the description is brief but covers the purpose. The template also asks that testing be done against real Tekmar hardware through the 482 gateway, and the description does not state whether this was done.

Resolution

Add a short description of what changed in the code, such as the switch from the serial module to serialx, the new serial parameters (9600 baud, 8 data bits, no parity, one stop bit), and the added OSError handling. State whether the changes were tested with Tekmar hardware through the 482 gateway. Confirm the branch is based on the latest upstream main branch. Keep the change limited to the migration, and move any unrelated edits to a separate PR.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • CodeRabbit Verify could not start. Follow the reply for details, then check again.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0635c382-85f3-413c-883e-e24b94bffb9c
Commits

Reviewing files that changed from the base of the PR and between a0487d2 and 9d2362a.

Files selected for processing: 1
  • tekmar_packetserv/rootfs/usr/local/packetserv/packetserv.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@WillCodeForCats

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot 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.

  • Fix comments: Fix CodeRabbit comments on this PR

@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown

CodeRabbit Verify cannot start because this repository is not enabled for PR Verify. Enable PR testing in Verify settings.

CodeRabbit Verify can be triggered again using the @coderabbitai verify command.

@WillCodeForCats

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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