Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce IntEnum or similar for printer states #611

Open
patkan opened this issue Dec 16, 2023 · 0 comments
Open

Introduce IntEnum or similar for printer states #611

patkan opened this issue Dec 16, 2023 · 0 comments

Comments

@patkan
Copy link
Member

patkan commented Dec 16, 2023

          The reason I didn't suggest RT_MASK_ONLINE is that its name is not consistent with the meaning of the returning value. According to [Esc/Pos](https://download4.epson.biz/sec_pubs/pos/reference_en/escpos/dle_eot.html), the int value 8 is for **Offline** status.

We could modify that constant and add a new one for offline:

RT_MASK_ONLINE: int = 0
RT_MASK_OFFLINE: int = 8

Then we could do:

if not state or state in [4, 5]:
    return RT_MASK_OFFLINE  # offline
return RT_MASK_ONLINE  # online

Originally posted by @belono in #607 (comment)

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

No branches or pull requests

1 participant