mirror of
https://github.com/onyx-and-iris/obsws-cli.git
synced 2025-05-20 16:10:26 +01:00
32 lines
715 B
Python
32 lines
715 B
Python
"""module for settings management."""
|
|
|
|
from pathlib import Path
|
|
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
"""Settings for the OBS WebSocket client."""
|
|
|
|
model_config = SettingsConfigDict(
|
|
env_file=(
|
|
'.env',
|
|
Path.home() / '.config' / 'obsws-cli' / 'obsws.env',
|
|
),
|
|
env_file_encoding='utf-8',
|
|
env_prefix='OBS_',
|
|
)
|
|
|
|
HOST: str = 'localhost'
|
|
PORT: int = 4455
|
|
PASSWORD: str = '' # No password by default
|
|
TIMEOUT: int = 5 # Timeout for requests in seconds
|
|
|
|
|
|
_settings = Settings().model_dump()
|
|
|
|
|
|
def get(key: str) -> str:
|
|
"""Get a setting by key."""
|
|
return _settings.get(key)
|