Ajout section Codex (conso 7j + statut limite) via dashboard Hermes
This commit is contained in:
@@ -13,7 +13,7 @@ from PIL import Image
|
||||
from playwright.async_api import async_playwright
|
||||
|
||||
from config import config
|
||||
from integrations import claude_usage, homeassistant, nas, weather
|
||||
from integrations import claude_usage, codex, homeassistant, nas, weather
|
||||
|
||||
TEMPLATES = Path(__file__).parent / "templates"
|
||||
|
||||
@@ -54,11 +54,12 @@ def _gauges(usage: claude_usage.ClaudeUsage) -> list[dict]:
|
||||
|
||||
async def build_context() -> dict:
|
||||
"""Récupère toutes les sources en parallèle et assemble le contexte du template."""
|
||||
usage, wx, ha, nas_status = await asyncio.gather(
|
||||
usage, wx, ha, nas_status, codex_status = await asyncio.gather(
|
||||
claude_usage.fetch_usage(),
|
||||
weather.fetch_weather(),
|
||||
homeassistant.fetch_states(),
|
||||
nas.fetch_status(),
|
||||
codex.fetch_status(),
|
||||
)
|
||||
|
||||
now = datetime.now(ZoneInfo(config.timezone))
|
||||
@@ -73,6 +74,7 @@ async def build_context() -> dict:
|
||||
"gauges": _gauges(usage),
|
||||
"ha_states": ha,
|
||||
"nas": nas_status,
|
||||
"codex": codex_status,
|
||||
"updated": now.strftime("%H:%M"),
|
||||
"stale": False,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user