Skip to content
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

🔨Add mealplan and calendar first day of week #72

Merged
merged 4 commits into from
Mar 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,12 @@ The following sub features can be enabled or disabled:

Set it `true` to enable it, `false` otherwise.

The following sub features can be set to specify a day (0-6), where 0 would
equal Sunday:

- `calendar_first_day_of_week`
- `meal_plan_first_day_of_week`

## Known issues and limitations

- Grocy support to provide custom lookup resources to lookup information
Expand Down
2 changes: 2 additions & 0 deletions grocy/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@
"tasks": "bool"
},
"tweaks": {
"calendar_first_day_of_week": "int(0,6)?",
"chores_assignment": "bool",
"meal_plan_first_day_of_week": "int(0,6)?",
"multiple_shopping_lists": "bool",
"stock_best_before_date_tracking": "bool",
"stock_location_tracking": "bool",
Expand Down
12 changes: 12 additions & 0 deletions grocy/rootfs/etc/services.d/php-fpm/run
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Home Assistant Community Add-on: Grocy
# Runs the PHP-FPM daemon
# ==============================================================================
declare caldayweek
declare mealday
export GROCY_CULTURE
export GROCY_CURRENCY
export GROCY_ENTRY_PAGE
Expand Down Expand Up @@ -41,10 +43,20 @@ if bashio::config.false 'features.tasks'; then
export GROCY_FEATURE_FLAG_TASKS=0
fi

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}
fi

if bashio::config.false 'tweaks.chores_assignment'; then
export GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS=0
fi

if bashio::config.has_value 'tweaks.meal_plan_first_day_of_week'; then
mealday=$(bashio::config 'tweaks.meal_plan_first_day_of_week')
export GROCY_MEAL_PLAN_FIRST_DAY_OF_WEEK=${mealday}
fi

if bashio::config.false 'tweaks.multiple_shopping_lists'; then
export GROCY_FEATURE_FLAG_SHOPPINGLIST_MULTIPLE_LISTS=0
fi
Expand Down