18 lines
608 B
Python
18 lines
608 B
Python
from __future__ import annotations
|
|
|
|
from typing import Dict, Any
|
|
|
|
class DERControllerAdapter:
|
|
"""Stub DER inverter controller adapter for MVP."""
|
|
|
|
def __init__(self, site_id: str):
|
|
self.site_id = site_id
|
|
|
|
def build_initial_state(self) -> Dict[str, Any]:
|
|
# Minimal initial state for a DER site
|
|
return {"site_id": self.site_id, "state": "idle", "dispatch": {}}
|
|
|
|
def apply_delta(self, plan_delta: Dict[str, Any]) -> Dict[str, Any]:
|
|
# In a real adapter, apply delta to local DERs. Here we echo back.
|
|
return {"site_id": self.site_id, "applied": plan_delta}
|