Skip to content

Commit

Permalink
Merge pull request #195 from AndreWohnsland/dev
Browse files Browse the repository at this point in the history
Add MAKER_ALCOHOL_FACTOR to scale base of cocktail alcohol
  • Loading branch information
AndreWohnsland authored Oct 19, 2024
2 parents db2e45b + 952a9c1 commit e815208
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ They can be used at own risk of CocktailBerry not working 100% properly.
| `MAKER_SEARCH_UPDATES` | Search for updates at program start |
| `MAKER_CHECK_BOTTLE` | Check if there is enough of each ingredient left |
| `MAKER_CLEAN_TIME` | Time the machine will execute the cleaning program |
| `MAKER_ALCOHOL_FACTOR` | Value to multiply alcoholic ingredients in all recipes |
| `MAKER_MAX_HAND_INGREDIENTS` | Max x ingredients are allowed to add by hand |
| `MAKER_CHECK_INTERNET` | Do a connection check at start for time adjustment window |
| `MAKER_USE_RECIPE_VOLUME` | Do not scale but use defined amounts |
Expand Down
3 changes: 3 additions & 0 deletions src/config/config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ class ConfigManager:
MAKER_SIMULTANEOUSLY_PUMPS: int = 16
# Time in seconds to execute clean program
MAKER_CLEAN_TIME: int = 20
# Base multiplier for alcohol in the recipe
MAKER_ALCOHOL_FACTOR: int = 100
# Option to invert pump direction
MAKER_PUMP_REVERSION: bool = False
# Pin used for the pump direction
Expand Down Expand Up @@ -161,6 +163,7 @@ def __init__(self) -> None:
"MAKER_PREPARE_VOLUME": ListType(IntType([build_number_limiter(25, 1000)], suffix="ml"), 1),
"MAKER_SIMULTANEOUSLY_PUMPS": IntType([build_number_limiter(1, MAX_SUPPORTED_BOTTLES)]),
"MAKER_CLEAN_TIME": IntType([build_number_limiter()], suffix="s"),
"MAKER_ALCOHOL_FACTOR": IntType([build_number_limiter(10, 200)], suffix="%"),
"MAKER_PUMP_REVERSION": BoolType(),
"MAKER_REVERSION_PIN": IntType([self._validate_pin_numbers]),
"MAKER_SEARCH_UPDATES": BoolType(),
Expand Down
3 changes: 3 additions & 0 deletions src/language.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,9 @@ ui:
MAKER_CLEAN_TIME:
en: 'Time in seconds the cleaning program is executed'
de: 'Zeit in Sekunden, die das Reinigungsprogramm ausgeführt wird'
MAKER_ALCOHOL_FACTOR:
en: 'Value to scale alcoholic ingredients in each recipe. Use this to decrease/increase the alcohol level of all cocktails. Default is 100%'
de: 'Skalierungsfaktor für alkoholische Zutaten in jedem Rezept. Verwende diesen, um den Alkoholgehalt aller Cocktails zu verringern/erhöhen. Standard ist 100%'
MAKER_PUMP_REVERSION:
en: 'Enable the reversion of the pump direction, needs according hardware for reversion, usually a relay'
de: 'Ermöglicht die Pumpenrichtung zu ändern, benötigt entsprechende Hardware, meist ein Relais'
Expand Down
2 changes: 1 addition & 1 deletion src/ui/setup_cocktail_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def _scale_cocktail(self, amount: int | None = None):
# overwrite the amount if the cocktail has a fixed volume
if cfg.MAKER_USE_RECIPE_VOLUME:
amount = self.cocktail.amount
factor = shared.alcohol_factor
factor = shared.alcohol_factor * (cfg.MAKER_ALCOHOL_FACTOR / 100) # remember this is percent
is_virgin = self.virgin_checkbox.isChecked()
if is_virgin:
factor = 0
Expand Down

0 comments on commit e815208

Please sign in to comment.