Initial Commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from dataclasses import dataclass
|
||||
|
||||
from dotenv import load_dotenv
|
||||
|
||||
|
||||
load_dotenv()
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class Config:
|
||||
database_url: str = os.getenv(
|
||||
"DATABASE_URL",
|
||||
"mysql+pymysql://switchbot:switchbot_password@localhost:3306/switchbot",
|
||||
)
|
||||
switchbot_token: str | None = os.getenv("SWITCHBOT_TOKEN")
|
||||
switchbot_secret: str | None = os.getenv("SWITCHBOT_SECRET")
|
||||
collect_interval_seconds: int = int(os.getenv("COLLECT_INTERVAL_SECONDS", "900"))
|
||||
app_timezone: str = os.getenv("APP_TIMEZONE", "Europe/London")
|
||||
flask_secret_key: str = os.getenv("FLASK_SECRET_KEY", "dev-only-secret")
|
||||
|
||||
|
||||
config = Config()
|
||||
Reference in New Issue
Block a user