Init
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
from functools import lru_cache
|
||||
from pathlib import Path
|
||||
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
app_host: str = "127.0.0.1"
|
||||
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 = 1400
|
||||
action_prepare_delay_ms: int = 650
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user