Initial Commit

This commit is contained in:
2026-06-01 21:02:36 +01:00
commit 4224a535ef
20 changed files with 1512 additions and 0 deletions
+25
View File
@@ -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()