* Mypy: Initial support

 * Add to pre-commit (currently installs own deps, could maybe changed
   to poetry venv in the future to reuse environment and don't need
   duplicated types deps).
 * Add type hints.

* Mypy: Add missing annotations
This commit is contained in:
Dominique Lasserre
2024-11-26 22:28:05 +01:00
committed by GitHub
parent 2a163569bc
commit 1163ddb4ac
31 changed files with 637 additions and 531 deletions

View File

@@ -4,7 +4,7 @@ from akkudoktoreos.devices.battery import PVAkku
class WechselrichterParameters(BaseModel):
max_leistung_wh: float = Field(10000, gt=0)
max_leistung_wh: float = Field(default=10000, gt=0)
class Wechselrichter:
@@ -14,9 +14,11 @@ class Wechselrichter:
)
self.akku = akku # Connection to a battery object
def energie_verarbeiten(self, erzeugung, verbrauch, hour):
verluste = 0 # Losses during processing
netzeinspeisung = 0 # Grid feed-in
def energie_verarbeiten(
self, erzeugung: float, verbrauch: float, hour: int
) -> tuple[float, float, float, float]:
verluste = 0.0 # Losses during processing
netzeinspeisung = 0.0 # Grid feed-in
netzbezug = 0.0 # Grid draw
eigenverbrauch = 0.0 # Self-consumption