This commit is contained in:
Bernd Bestel
2023-05-19 18:08:26 +02:00
parent 49daed6c2b
commit 5f65f2abd0
69 changed files with 204 additions and 502 deletions

View File

@@ -1,15 +1,15 @@
grocycode
Grocycode
==========
grocycode is, in essence, a simple way to reference to arbitrary grocy entities.
Each grocycode includes a magic, an entitiy identifier, an id and an ordered set of extra data.
It is supported to be entered anywhere grocy expects one to read a barcode, but can also reference
grocy-internal properties like specific stock entries, or specific batteries.
Grocycode is, in essence, a simple way to reference to arbitrary Grocy entities.
Each Grocycode includes a magic, an entitiy identifier, an id and an ordered set of extra data.
It is supported to be entered anywhere Grocy expects one to read a barcode, but can also reference
Grocy-internal properties like specific stock entries, or specific batteries.
Serialization
----
There are three mandatory parts in a grocycode:
There are three mandatory parts in a Grocycode:
1. The magic `grcy`
2. An entity identifer matching the regular expression `[a-z]+` (that is, lowercase english alphabet without any fancy accents, minimum length 1 character).

View File

@@ -6,8 +6,8 @@ To enable label printing, set `FEATURE_FLAG_LABEL_PRINTER` to `true`in your `con
Why webhook?
---
Label printers come in all shapes and forms, and your particular one is probably not the one used by the author of this feature. Also, grocy may does not have a
direct connection to a local label printer (e.g. grocy is hosted in a cloud vps). Thus, a lightweight implementation is provided by grocy: whenever something
Label printers come in all shapes and forms, and your particular one is probably not the one used by the author of this feature. Also, Grocy may does not have a
direct connection to a local label printer (e.g. Grocy is hosted in a cloud vps). Thus, a lightweight implementation is provided by Grocy: whenever something
should print, a POST request to a configured URL is made. The target then is responsible for label printing.
Reference implementation
@@ -19,8 +19,8 @@ implemented into [a fork of brother_ql_web](https://github.com/mistressofjellyfi
Webhook request
---
Requests can be configured to be sent server-side (that is, from the machine hosting grocy through GuzzleHttp) or by an AJAX request directly from the browser.
The latter is neccesary for situations where the grocy hosting machine cannot reach your label printer, however server-side requests are a bit faster and
Requests can be configured to be sent server-side (that is, from the machine hosting Grocy through GuzzleHttp) or by an AJAX request directly from the browser.
The latter is neccesary for situations where the Grocy hosting machine cannot reach your label printer, however server-side requests are a bit faster and
tend to be more stable.
Both methods fire this request upon printing: