Json configuration (#141)

* Add json config
* Adjust code to new config

---------

Co-authored-by: Chris <git@nootch.de>
This commit is contained in:
Chris
2024-11-11 21:38:13 +01:00
committed by GitHub
parent fc74cde56f
commit ed3226e522
21 changed files with 726 additions and 171 deletions

View File

@@ -4,7 +4,8 @@ import pytest
from akkudoktoreos.class_akku import PVAkku
from akkudoktoreos.class_ems import EnergieManagementSystem
from akkudoktoreos.class_haushaltsgeraet import Haushaltsgeraet
from akkudoktoreos.class_inverter import Wechselrichter # Example import
from akkudoktoreos.class_inverter import Wechselrichter
from akkudoktoreos.config import AppConfig
prediction_hours = 48
optimization_hours = 24
@@ -13,7 +14,7 @@ start_hour = 1
# Example initialization of necessary components
@pytest.fixture
def create_ems_instance():
def create_ems_instance(tmp_config: AppConfig) -> EnergieManagementSystem:
"""Fixture to create an EnergieManagementSystem instance with given test parameters."""
# Initialize the battery and the inverter
akku = PVAkku(kapazitaet_wh=5000, start_soc_prozent=80, hours=48, min_soc_prozent=10)
@@ -189,6 +190,7 @@ def create_ems_instance():
# Initialize the energy management system with the respective parameters
ems = EnergieManagementSystem(
config=tmp_config.eos,
pv_prognose_wh=pv_prognose_wh,
strompreis_euro_pro_wh=strompreis_euro_pro_wh,
einspeiseverguetung_euro_pro_wh=einspeiseverguetung_euro_pro_wh,