-
-
Notifications
You must be signed in to change notification settings - Fork 79
Adds support for printer configuration #422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
b1a5a77
372c259
84bc21d
0fbc3fe
0cb55af
a7c6dec
f86723c
c7a862e
c4b3a99
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -31,6 +31,8 @@ options: | |||||||||||||||||||||||||||||
| shoppinglist: true | ||||||||||||||||||||||||||||||
| stock: true | ||||||||||||||||||||||||||||||
| tasks: true | ||||||||||||||||||||||||||||||
| label_printer: false | ||||||||||||||||||||||||||||||
| thermal_printer: false | ||||||||||||||||||||||||||||||
| tweaks: | ||||||||||||||||||||||||||||||
| chores_assignment: true | ||||||||||||||||||||||||||||||
| multiple_shopping_lists: true | ||||||||||||||||||||||||||||||
|
|
@@ -58,6 +60,8 @@ schema: | |||||||||||||||||||||||||||||
| shoppinglist: bool | ||||||||||||||||||||||||||||||
| stock: bool | ||||||||||||||||||||||||||||||
| tasks: bool | ||||||||||||||||||||||||||||||
| label_printer: bool | ||||||||||||||||||||||||||||||
| thermal_printer: bool | ||||||||||||||||||||||||||||||
| tweaks: | ||||||||||||||||||||||||||||||
| calendar_first_day_of_week: int(0,6)? | ||||||||||||||||||||||||||||||
| chores_assignment: bool | ||||||||||||||||||||||||||||||
|
|
@@ -69,6 +73,14 @@ schema: | |||||||||||||||||||||||||||||
| stock_product_freezing: bool | ||||||||||||||||||||||||||||||
| stock_product_opened_tracking: bool | ||||||||||||||||||||||||||||||
| stock_count_opened_products_against_minimum_stock_amount: bool | ||||||||||||||||||||||||||||||
| label_printer_webhook: str | ||||||||||||||||||||||||||||||
| label_printer_run_server: bool | ||||||||||||||||||||||||||||||
| label_printer_params: str | ||||||||||||||||||||||||||||||
| label_printer_hook_json: bool | ||||||||||||||||||||||||||||||
| tprinter_print_quantity_name: bool | ||||||||||||||||||||||||||||||
| tprinter_print_notes: bool | ||||||||||||||||||||||||||||||
| tprinter_ip: str | ||||||||||||||||||||||||||||||
|
Comment on lines
+76
to
+82
|
||||||||||||||||||||||||||||||
| label_printer_webhook: str | |
| label_printer_run_server: bool | |
| label_printer_params: str | |
| label_printer_hook_json: bool | |
| tprinter_print_quantity_name: bool | |
| tprinter_print_notes: bool | |
| tprinter_ip: str | |
| label_printer_webhook: str? | |
| label_printer_run_server: bool? | |
| label_printer_params: str? | |
| label_printer_hook_json: bool? | |
| tprinter_print_quantity_name: bool? | |
| tprinter_print_notes: bool? | |
| tprinter_ip: str? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense to me.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -6,6 +6,10 @@ | |||||||||||||||||
| # ============================================================================== | ||||||||||||||||||
| declare caldayweek | ||||||||||||||||||
| declare mealday | ||||||||||||||||||
| declare label_printer_webhook | ||||||||||||||||||
| declare label_printer_params | ||||||||||||||||||
| declare tprinter_ip | ||||||||||||||||||
| declare tprinter_port | ||||||||||||||||||
| export GROCY_CULTURE | ||||||||||||||||||
| export GROCY_CURRENCY | ||||||||||||||||||
| export GROCY_ENTRY_PAGE | ||||||||||||||||||
|
|
@@ -44,6 +48,15 @@ if bashio::config.false 'features.tasks'; then | |||||||||||||||||
| export GROCY_FEATURE_FLAG_TASKS=0 | ||||||||||||||||||
| fi | ||||||||||||||||||
|
|
||||||||||||||||||
| if bashio::config.true 'features.label_printer'; then | ||||||||||||||||||
| export GROCY_FEATURE_FLAG_LABEL_PRINTER=1 | ||||||||||||||||||
| fi | ||||||||||||||||||
|
|
||||||||||||||||||
| if bashio::config.true 'features.thermal_printer'; then | ||||||||||||||||||
| export FEATURE_FLAG_THERMAL_PRINTER=1 | ||||||||||||||||||
| export GROCY_TPRINTER_IS_NETWORK_PRINTER=1 | ||||||||||||||||||
| fi | ||||||||||||||||||
|
Comment on lines
+55
to
+58
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainFix the feature flag naming convention. Line 56 exports Apply this diff to fix the naming convention: if bashio::config.true 'features.thermal_printer'; then
- export FEATURE_FLAG_THERMAL_PRINTER=1
+ export GROCY_FEATURE_FLAG_THERMAL_PRINTER=1
export GROCY_TPRINTER_IS_NETWORK_PRINTER=1
fiPlease also verify that Grocy expects 🌐 Web query: 💡 Result: The feature flag is FEATURE_FLAG_THERMAL_PRINTER — exposed as an environment variable with the GROCY_ prefix, i.e. GROCY_FEATURE_FLAG_THERMAL_PRINTER. [1][2][3] Sources:
Fix the feature flag naming convention. Line 56 exports Apply this diff: if bashio::config.true 'features.thermal_printer'; then
- export FEATURE_FLAG_THERMAL_PRINTER=1
+ export GROCY_FEATURE_FLAG_THERMAL_PRINTER=1
export GROCY_TPRINTER_IS_NETWORK_PRINTER=1
fi📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Opps missed one, I agree with this suggestion There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @valadas, thank you for confirming! Looking forward to seeing this fixed in the next update. 👍 |
||||||||||||||||||
|
|
||||||||||||||||||
| if bashio::config.has_value 'tweaks.calendar_first_day_of_week'; then | ||||||||||||||||||
| caldayweek=$(bashio::config 'tweaks.calendar_first_day_of_week') | ||||||||||||||||||
| export GROCY_CALENDAR_FIRST_DAY_OF_WEEK=${caldayweek} | ||||||||||||||||||
|
|
@@ -86,6 +99,42 @@ if bashio::config.false 'tweaks.stock_count_opened_products_against_minimum_stoc | |||||||||||||||||
| export GROCY_FEATURE_SETTING_STOCK_COUNT_OPENED_PRODUCTS_AGAINST_MINIMUM_STOCK_AMOUNT=0 | ||||||||||||||||||
| fi | ||||||||||||||||||
|
|
||||||||||||||||||
| if bashio::config.has_value 'tweaks.label_printer_webhook'; then | ||||||||||||||||||
| label_printer_webhook=$(bashio::config 'tweaks.label_printer_webhook') | ||||||||||||||||||
| export GROCY_LABEL_PRINTER_WEBHOOK=${label_printer_webhook} | ||||||||||||||||||
| fi | ||||||||||||||||||
|
|
||||||||||||||||||
| if bashio::config.false 'tweaks.label_printer_run_server'; then | ||||||||||||||||||
| export GROCY_LABEL_PRINTER_RUN_SERVER=0 | ||||||||||||||||||
| fi | ||||||||||||||||||
|
|
||||||||||||||||||
| if bashio::config.has_value 'tweaks.label_printer_params'; then | ||||||||||||||||||
| label_printer_params=$(bashio::config 'tweaks.label_printer_params') | ||||||||||||||||||
| export GROCY_LABEL_PRINTER_PARAMS=${label_printer_params} | ||||||||||||||||||
| fi | ||||||||||||||||||
|
|
||||||||||||||||||
| if bashio::config.true 'tweaks.label_printer_hook_json'; then | ||||||||||||||||||
| export GROCY_LABEL_PRINTER_HOOK_JSON=1 | ||||||||||||||||||
| fi | ||||||||||||||||||
|
|
||||||||||||||||||
| if bashio::config.false 'tweaks.tprinter_print_quantity_name'; then | ||||||||||||||||||
| export GROCY_TPRINTER_PRINT_QUANTITY_NAME=0 | ||||||||||||||||||
| fi | ||||||||||||||||||
|
|
||||||||||||||||||
| if bashio::config.false 'tweaks.tprinter_print_notes'; then | ||||||||||||||||||
| export GROCY_TPRINTER_PRINT_NOTES=0 | ||||||||||||||||||
| fi | ||||||||||||||||||
|
|
||||||||||||||||||
| if bashio::config.has_value 'tweaks.tprinter_ip'; then | ||||||||||||||||||
| tprinter_ip=$(bashio::config 'tweaks.tprinter_ip') | ||||||||||||||||||
| export GROCY_TPRINTER_IP=${tprinter_ip} | ||||||||||||||||||
| fi | ||||||||||||||||||
|
|
||||||||||||||||||
| if bashio::config.has_value 'tweaks.tprinter_port'; then | ||||||||||||||||||
| tprinter_port=$(bashio::config 'tweaks.tprinter_port') | ||||||||||||||||||
| export GROCY_TPRINTER_PORT=${tprinter_port} | ||||||||||||||||||
| fi | ||||||||||||||||||
|
|
||||||||||||||||||
| GROCY_CULTURE=$(bashio::config "culture") | ||||||||||||||||||
| GROCY_CURRENCY=$(bashio::config "currency") | ||||||||||||||||||
| GROCY_ENTRY_PAGE=$(bashio::config 'entry_page') | ||||||||||||||||||
|
|
||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The formatting is inconsistent with other list items in the same section. Lines 211-213 use a plain description format without a colon, but this line includes a colon separator. For consistency, either remove the colon and reformat to match lines 211-213, or add colons to the other items.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch