Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions packages/helpermodules/measurement_logging/process_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,10 +548,14 @@ def get_single_value(source: dict, default: int = 0) -> float:
log.exception("Fehler beim Berechnen der Leistung")
# next_entry may contain new modules, we add them here
try:
for module in next_entry[type].keys():
for module, module_data in next_entry[type].items():
if module not in entry[type].keys():
log.debug(f"adding module {module} from next entry")
entry[type].update({module: {"energy_imported": 0.0, "energy_exported": 0.0}})
if calculation in [CalculationType.POWER, CalculationType.ALL]:
module_data.update({"power_average": 0, "power_imported": 0, "power_exported": 0})
if calculation in [CalculationType.ENERGY, CalculationType.ALL]:
module_data.update({"energy_imported": 0, "energy_exported": 0})
entry[type].update({module: module_data})
except KeyError:
# catch missing "type"
pass
Expand Down