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)