Improve and extend the _read() method availability for its users and related methods. Part 2: Response format validator#711
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #711 +/- ##
==========================================
+ Coverage 81.90% 82.82% +0.91%
==========================================
Files 21 21
Lines 1708 1729 +21
Branches 267 270 +3
==========================================
+ Hits 1399 1432 +33
+ Misses 230 216 -14
- Partials 79 81 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
belono
marked this pull request as ready for review
October 5, 2025 10:56
belono
force-pushed
the
status_validator
branch
from
April 21, 2026 21:48
3742883 to
0fa5b53
Compare
belono
force-pushed
the
status_validator
branch
from
April 21, 2026 22:15
151bbac to
e37e39e
Compare
patkan
reviewed
Jul 27, 2026
patkan
approved these changes
Jul 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This is part 2 of the series to improve and extend the availability of the _read() method.
Part 1: #709
Part 2: Add a simple response format validator when querying for status:
As stated at the Epson ESC/POS reference guide:
So a status response consists of a byte which bits 0 and 7 are fixed to 0, and bits 1 and 4 are fixed to 1. The remaining bits contain the response to the query according to the tables given in the aforementioned reference guide.
This PR tries to reduce the possibility of false positives when interpreting data from the printer buffer as status responses by checking that the data read is at least in the right response format:
ValidationErrorexception if validation fails, or return an empty response (default).query_status()users:is_online()andpaper_status()methods.Part 3: #712
Part 4: #714
Tested with
TM-U210 Parallel port printer