Skip to content

feat(serial): RS-485 hardware auto-RTS in the mapping form (v2.6.3)#23

Merged
haliskilic merged 1 commit into
mainfrom
feat-rs485-ui
Jun 11, 2026
Merged

feat(serial): RS-485 hardware auto-RTS in the mapping form (v2.6.3)#23
haliskilic merged 1 commit into
mainfrom
feat-rs485-ui

Conversation

@haliskilic

Copy link
Copy Markdown
Owner

Closes the docs gap flagged in the v2.6.2 review: RS-485 was a working but UI-less feature. The engine already applied it (serial_io.py → pyserial rs485_mode with RS485Settings), but the fields were only reachable via JSON import / the REST API.

What

  • Mapping form (_mapping_form.html): a collapsible RS-485 (half-duplex, hardware auto-RTS) section on each serial port — Enable, RTS delay before TX (ms), RTS delay after TX (ms), RTS high during TX. Pure HTML <details> (CSP-safe, no inline JS; auto-opens when RS-485 is already enabled).
  • Form parsing (routes._serial_dict): the RS-485 fields parse into serial.advanced.
  • Edit preservation: the form now owns the RS-485 fields, so _preserve_unmanaged_fields no longer copies the whole advanced block on edit — it carries over only the two the form doesn't expose (hangup_when_done, nobreak). test_preserve_unmanaged_fields_on_edit updated to assert the new semantics.

Notes

  • Applies to both the primary serial port and the serial↔serial bridge's second port (shared macro).
  • RS-485 is a Linux TIOCSRS485 feature; the driver must support it (documented in the form hint).

Verification

--version → 2.6.3 · ruff clean · 33/33 tests pass. README (TR/EN) + ROADMAP updated (shipped, removed from v2.7); add-mapping screenshot regenerated.

The engine already applied RS-485 via pyserial rs485_mode (serial_io.py), but the
settings were only reachable through JSON import / the REST API. Expose them in the UI:

- _mapping_form.html: a collapsible "RS-485 (half-duplex, hardware auto-RTS)" section
  per serial port — enable + RTS pre/post-TX delays (ms) + RTS-high-during-TX. Pure
  HTML <details> (CSP-safe, no inline JS).
- routes _serial_dict: parse the RS-485 fields into serial.advanced.
- _preserve_unmanaged_fields: the form now OWNS the RS-485 fields, so stop copying the
  whole `advanced` block over on edit — only carry the two it doesn't expose
  (hangup_when_done, nobreak). Updated test_preserve_unmanaged_fields_on_edit to match.
- README (TR/EN): RS-485 is a UI feature now; ROADMAP: shipped (removed from v2.7).
- Screenshots regenerated (add-mapping form shows the RS-485 section). Version 2.6.3.
@haliskilic
haliskilic merged commit 1338e88 into main Jun 11, 2026
18 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.

1 participant