Skip to content

Add persistent Epson print density and speed settings - #823

Open
willagio wants to merge 2 commits into
python-escpos:masterfrom
willagio:feature/epson-persistent-quality
Open

willagio wants to merge 2 commits into
python-escpos:masterfrom
willagio:feature/epson-persistent-quality

Conversation

@willagio

Copy link
Copy Markdown

Description

Add get_persistent_print_quality() and set_persistent_print_quality() for printers documenting Epson GS ( E customized values 5 (density) and 6 (speed). These methods provide settings that survive power cycles alongside the existing temporary set_print_speed() method. Values use each model's raw unsigned 16-bit encoding.

The setter waits for the setting-mode notice, writes only supplied values, verifies readback, and attempts to exit setting mode in finally. Backends without raw printer replies are rejected before output. Errors propagate without automatic fallback or NV-write retries; a failed operation may already have changed settings. The docstrings explain reset effects and reopening the connection.

Command references: Epson Function 5 and Function 6.

Tested with

  • Epson TM-T88V over USB: normal-mode queries, save/readback, and reconnect after reset, preserving raw density 6 (130%) and speed 1. Other models have not been hardware-tested.
  • Python 3.13.7: 471 passed, 9 skipped, including 51 new cases for command encoding, fragmented/invalid replies, transport rejection, and cleanup after errors.
  • Ruff, mypy for changed code/tests, and git diff --check pass.

@willagio
willagio marked this pull request as ready for review November 11, 2026 22:37
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