M6-T05: add Tibber GraphQL client + price refresh service + schedule

- app/integrations/tibber/client.py: fetch_price_range/fetch_current_price
  (priceInfoRange QUARTER_HOURLY, startsAt->UTC, no fixed node count assumption),
  TibberError/TibberAuthError; token never logged or put in exception text.
- app/services/tibber_prices.py: refresh_prices upserts by starts_at (idempotent),
  no-op unless an active kind=tibber contract + token exist.
- main.py: hourly tibber-refresh job (existing jobs/MQTT untouched). Tests added.
This commit is contained in:
2026-06-23 21:35:29 +02:00
parent 4284bd40a7
commit 7e266a21eb
7 changed files with 1351 additions and 1 deletions
+10
View File
@@ -0,0 +1,10 @@
"""Tibber dynamic electricity pricing integration.
This package provides:
- ``client``: HTTP client for the Tibber GraphQL API (price fetching).
- Custom exceptions: ``TibberError`` (base) and ``TibberAuthError`` (auth failure).
Usage::
from app.integrations.tibber.client import fetch_price_range, TibberAuthError
"""