Skip to content

Introduce IntEnum or similar for printer states #611

@patkan

Description

@patkan
          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)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions