power-compare/app/isolarcloud/schemas.py
dlawler489 84c4922bbc Initial commit: solar usage vs AER plan comparison app
FastAPI app that pulls interval usage from Sungrow iSolarCloud (OAuth2),
caches AER Consumer Data Right electricity plan data, and compares actual
metered usage against every available plan to estimate real annual cost
(TOU, tiered feed-in, and flat tariffs).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-09 11:07:01 +10:00

23 lines
598 B
Python

from datetime import datetime
from pydantic import BaseModel
class IntervalDataPoint(BaseModel):
ts: datetime
generation_kwh: float
load_kwh: float
import_kwh: float
export_kwh: float
resolution_minutes: int
def as_row(self, source: str) -> dict:
return {
"ts": self.ts,
"source": source,
"generation_kwh": self.generation_kwh,
"load_kwh": self.load_kwh,
"import_kwh": self.import_kwh,
"export_kwh": self.export_kwh,
"resolution_minutes": self.resolution_minutes,
}