diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 06b0a13..0464b9a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,18 +9,21 @@ jobs: matrix: python-version: ["3.8", "3.10", "3.11"] steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - pip install --user pdm - pdm sync -G dev - - name: Format - run: | - pdm run ruff format --check . - - name: Lint - run: | - pdm run ruff check . + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + pip install --user pdm + pdm sync -G dev + - name: Format + run: | + pdm run ruff format --check . + - name: Lint + run: | + pdm run ruff check . + - name: Djlint + run: | + pdm run djlint coffeebuddy diff --git a/coffeebuddy/extensions/coffeemaker.py b/coffeebuddy/extensions/coffeemaker.py index e95f74e..ebcd6fe 100644 --- a/coffeebuddy/extensions/coffeemaker.py +++ b/coffeebuddy/extensions/coffeemaker.py @@ -40,6 +40,7 @@ def brew(self, data): def init(): logging.getLogger(__name__).info("Init") app = flask.current_app + config = app.config.get("COFFEEMAKER", None) or {} - if (brew_time := app.config.get("COFFEEMAKER_MOCK_BREW_TIME", False)) is not False: - CoffeeMakerMock(brew_time=brew_time) + if "mock" in config: + CoffeeMakerMock(brew_time=config["mock"]) diff --git a/coffeebuddy/ui/__init__.py b/coffeebuddy/ui/__init__.py index cef229a..1055aab 100644 --- a/coffeebuddy/ui/__init__.py +++ b/coffeebuddy/ui/__init__.py @@ -40,7 +40,11 @@ def url(site: str, **kwargs): for key, value in kwargs.items(): if isinstance(value, bytes): kwargs[key] = value.hex() - return site + "?" + "&".join(f"{key}={value}" for key, value in kwargs.items()) + return ( + site + + "?" + + "&".join(f"{key}={value}" if value else key for key, value in kwargs.items()) + ) @flask.current_app.context_processor diff --git a/coffeebuddy/ui/base/templates/selectuser.html b/coffeebuddy/ui/base/templates/selectuser.html index ffff30d..5bf95b5 100644 --- a/coffeebuddy/ui/base/templates/selectuser.html +++ b/coffeebuddy/ui/base/templates/selectuser.html @@ -43,7 +43,7 @@
{{ hexstr(user.tag) }}
- 01020304
or
- 01 02 03 04
-
-
- 01020304
or
+ 01 02 03 04
+
+