pklaus / brother_ql_web

A Python-based web service to print labels on Brother QL label printers. Based on brother_ql: https://github.com/pklaus/brother_ql
GNU General Public License v3.0
254 stars 124 forks source link

Autodetect the loaded label type #2

Open splitbrain opened 7 years ago

splitbrain commented 7 years ago

There's a command to let the printer return the currently loaded label type. It would make sense to use that to only display label options that are currently possible.

pklaus commented 7 years ago

In principle this is correct. Unfortunately, reading the status via Ethernet is not so simple. It works via SNMP (different protocol, different port). As this software is made to be compatible with all three backends in brother_ql (Ethernet, PyUSB, Linux Kernel), a solution should work with all of them.

In addition: How do I know, when to check the inserted labe/tape? Polling continuously? Not sure...

In my opinion the clean way out is to add a command line parameter to brother_ql_web.py where the user can a specify the label size manually, e.g. --default-label-size. If left out, the software could try to query the printer once at startup (if that fails, assume 62mm). Whenever the web interface is opened then, the dropdown menu would default to that label size.

pklaus commented 7 years ago

I now added a command line switch for the default label size in f950735. It still doesn't check the actual label/tape inserted into the printer but allows you to specify the one the web UI should default to.