mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2025-10-11 11:56:17 +00:00
Mypy (#217)
* 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:
committed by
GitHub
parent
2a163569bc
commit
1163ddb4ac
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user