Title: Introduce IntEnum or similar for printer states · Issue #611 · python-escpos/python-escpos · GitHub
Open Graph Title: Introduce IntEnum or similar for printer states · Issue #611 · python-escpos/python-escpos
X Title: Introduce IntEnum or similar for printer states · Issue #611 · python-escpos/python-escpos
Description: 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 ...
Open Graph Description: 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/e...
X Description: 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_...
Opengraph URL: https://github.com/python-escpos/python-escpos/issues/611
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Introduce IntEnum or similar for printer states","articleBody":" 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.\r\n\r\nWe could modify that constant and add a new one for offline:\r\n```python\r\nRT_MASK_ONLINE: int = 0\r\nRT_MASK_OFFLINE: int = 8\r\n```\r\nThen we could do:\r\n```python\r\nif not state or state in [4, 5]:\r\n return RT_MASK_OFFLINE # offline\r\nreturn RT_MASK_ONLINE # online\r\n```\r\n\r\n_Originally posted by @belono in https://github.com/python-escpos/python-escpos/pull/607#discussion_r1428892456_\r\n ","author":{"url":"https://github.com/patkan","@type":"Person","name":"patkan"},"datePublished":"2023-12-16T20:58:53.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/611/python-escpos/issues/611"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:48212e03-219f-253f-7ba8-602fb8e1ac97 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8BB8:30B552:CA0C2C:128331E:6A4E2C8B |
| html-safe-nonce | 5398a186ccb9dcf34b10615324fdaab310089873ea15820b1d9e5f9b95b23f7a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QkI4OjMwQjU1MjpDQTBDMkM6MTI4MzMxRTo2QTRFMkM4QiIsInZpc2l0b3JfaWQiOiI1NjI0Nzg3OTAxMDM4MzQxMjU5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | a0aeecdf8bc96b97c36404b85c35126c6a3be66460d51c22eb7828a3ea9fd831 |
| hovercard-subject-tag | issue:2044956072 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-escpos/python-escpos/611/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e316050fb6a7540b4cbb430f13e7ab8e6da4ff3507a035aadfddd549e5968ef2/python-escpos/python-escpos/issues/611 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e316050fb6a7540b4cbb430f13e7ab8e6da4ff3507a035aadfddd549e5968ef2/python-escpos/python-escpos/issues/611 |
| og:image:alt | 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/e... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | patkan |
| hostname | github.com |
| expected-hostname | github.com |
| None | 030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-escpos/python-escpos git https://github.com/python-escpos/python-escpos.git |
| octolytics-dimension-user_id | 16302939 |
| octolytics-dimension-user_login | python-escpos |
| octolytics-dimension-repository_id | 32363483 |
| octolytics-dimension-repository_nwo | python-escpos/python-escpos |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 32363483 |
| octolytics-dimension-repository_network_root_nwo | python-escpos/python-escpos |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d9dd20d38f8ae3c4cb6b597807431db300d0bd2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width