inventree / inventree-brother-plugin

Label printing plugin for Brother series printers
MIT License
18 stars 14 forks source link

Migrate to "machines" interface #32

Closed SchrodingersGat closed 3 weeks ago

SchrodingersGat commented 9 months ago

Ref: https://github.com/inventree/InvenTree/pull/4824

Once the linked PR is merged, update this plugin to make use of the new machines interface. With this we should be able to:

simonkuehling commented 1 month ago

As the machines interface seems to be up and running - is there any reason not to try to go ahead with this? Looking at the inventree-cups-plugin it should be pretty straight forward and I could give it a try, unless you happen to have something cooking but not released yet already... I have two different network connected Brother models for testing that I would like to use at different locations in the company.

SchrodingersGat commented 1 month ago

@simonkuehling I would appreciate you taking the lead on this! It would be great to support multiple machines for this, 100%

LMK if you hit any problems on the way.

simonkuehling commented 4 weeks ago

@SchrodingersGat I have something working now - could you have a quick look at https://github.com/simonkuehling/inventree-brother-plugin/blob/machine-registry-integration/inventree_brother/brother_plugin.py for comments?

there could be a bit more actual logic tracking the machine status - but I'm not sure if we get any information in this regard out of the BrotherQL library...

One issue is remaining right now: when printing a label, I get two notification popups in the bottom right corner (using PUI) - one with "success" and another says label generation failed:

I cannot find any errors (running in vscode devcontainer with demo dataset at the moment) - do you have an idea?

matmair commented 4 weeks ago

@simonkuehling this looks promising - maybe open up a PR, this feels pretty ready. Regarding status: there are some fairly new status-requesting APIs in borther-ql_inventree that could be helpful. I would like to keep the stump you already have for now as there is probably some testing and discussion required for states. Sounds good?

matmair commented 4 weeks ago

Ref https://github.com/inventree/inventree-brother-plugin/issues/43, https://github.com/inventree/inventree-brother-plugin/issues/28

wolflu05 commented 4 weeks ago

The error you are seeing is in the frontend code, because machines make use of the async printing, and that currently falsely shows an error to the user in PUI. That still needs to be implemented on the frontend side. Maybe with web sockets or polling and a notification with a progress bar at the bottom.

simonkuehling commented 4 weeks ago

@matmair Sure, I opened a PR at https://github.com/inventree/inventree-brother-plugin/pull/46

@wolflu05 I see, thanks for the pointer!

SchrodingersGat commented 4 weeks ago

@wolflu05 is there an outstanding issue for the PUI bug you referenced?

wolflu05 commented 3 weeks ago

Not sure, but I don't think so. I haven't added this implementation.

matmair commented 3 weeks ago

Closed with https://github.com/inventree/inventree-brother-plugin/pull/46