From c3d68bb45a0c372dca888cc997742f049f7ba748 Mon Sep 17 00:00:00 2001 From: Bob Steers Date: Fri, 5 Jan 2024 17:51:46 +0100 Subject: [PATCH] use brewblox_tilt_ prefix --- brewblox_tilt/models.py | 6 +++--- docker-compose.yml | 4 ++-- parse_appenv.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/brewblox_tilt/models.py b/brewblox_tilt/models.py index aa6317a..612747b 100644 --- a/brewblox_tilt/models.py +++ b/brewblox_tilt/models.py @@ -1,13 +1,13 @@ from typing import Literal -from pydantic import BaseModel +from pydantic import BaseModel, Field from pydantic_settings import BaseSettings, SettingsConfigDict class ServiceConfig(BaseSettings): model_config = SettingsConfigDict( env_file='.appenv', - env_prefix='brewblox_', + env_prefix='brewblox_tilt_', case_sensitive=False, json_schema_extra='ignore', ) @@ -24,7 +24,7 @@ class ServiceConfig(BaseSettings): scan_duration: float = 5 inactive_scan_interval: float = 5 active_scan_interval: float = 10 - simulate: list[str] | None = None + simulate: list[str] = Field(default_factory=list) class TiltEvent(BaseModel): diff --git a/docker-compose.yml b/docker-compose.yml index e67f668..4b26291 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,9 +9,9 @@ services: image: ghcr.io/brewblox/brewblox-tilt:local privileged: true environment: - - BREWBLOX_DEBUG=True - UVICORN_RELOAD=True - # - BREWBLOX_SIMULATE=["Mauve", "Lila"] + - BREWBLOX_TILT_DEBUG=True + # - BREWBLOX_TILT_SIMULATE=["Mauve","Lila"] restart: unless-stopped volumes: - type: bind diff --git a/parse_appenv.py b/parse_appenv.py index e7885d2..7f9b7e3 100644 --- a/parse_appenv.py +++ b/parse_appenv.py @@ -30,7 +30,7 @@ def parse_cmd_args(raw_args: list[str]) -> tuple[argparse.Namespace, list[str]]: args, unknown = parse_cmd_args(sys.argv[1:]) if unknown: print(f'WARNING: ignoring unknown CMD arguments: {unknown}', file=sys.stderr) - output = [f'brewblox_{k}={shlex.quote(str(v))}' + output = [f'brewblox_tilt_{k}={shlex.quote(str(v))}' for k, v in vars(args).items() if v is not None and v is not False @@ -40,4 +40,4 @@ def parse_cmd_args(raw_args: list[str]) -> tuple[argparse.Namespace, list[str]]: # Special exception for list variables if args.simulate: sim_names = json.dumps(list(args.simulate)) - print(f"brewblox_simulate='{sim_names}'") + print(f"brewblox_tilt_simulate='{sim_names}'")