30 lines
754 B
Python
30 lines
754 B
Python
from functools import lru_cache
|
|
from pathlib import Path
|
|
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
app_host: str = "0.0.0.0"
|
|
app_port: int = 8000
|
|
public_base_url: str = "http://127.0.0.1:8000"
|
|
|
|
wall_width: int = 14880
|
|
wall_height: int = 3510
|
|
target_fps: int = 60
|
|
|
|
switch_prepare_delay_ms: int = 2000
|
|
action_prepare_delay_ms: int = 900
|
|
initial_state_delay_ms: int = 160
|
|
command_ttl_seconds: int = 45
|
|
|
|
scene_config: Path = Path("config/scenes.json")
|
|
tile_config: Path = Path("config/tiles.json")
|
|
|
|
model_config = SettingsConfigDict(env_prefix="LED_", env_file=".env", extra="ignore")
|
|
|
|
|
|
@lru_cache
|
|
def get_settings() -> Settings:
|
|
return Settings()
|