Skip to content

Commit

Permalink
error message virtual counter (#2052)
Browse files Browse the repository at this point in the history
* error message virtual counter

* Update packages/modules/common/store/_counter.py

Co-authored-by: benderl <benderl@users.noreply.github.com>

---------

Co-authored-by: benderl <benderl@users.noreply.github.com>
  • Loading branch information
LKuemmel and benderl authored Dec 17, 2024
1 parent 76d6958 commit 3c8156b
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions packages/modules/common/store/_counter.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,16 @@ def add_exported(element):
for element in elements:
if element["type"] == ComponentType.CHARGEPOINT.value:
chargepoint = data.data.cp_data[f"cp{element['id']}"]
self.currents = list(map(add,
self.currents,
convert_cp_currents_to_evu_currents(
chargepoint.data.config.phase_1,
chargepoint.data.get.currents)))
try:
self.currents = list(map(add,
self.currents,
convert_cp_currents_to_evu_currents(
chargepoint.data.config.phase_1,
chargepoint.data.get.currents)))
except KeyError:
raise KeyError("Für den virtuellen Zähler muss der Anschluss der Phasen von Ladepunkt"
f" {chargepoint.data.config.name} an die Phasen des EVU Zählers "
"angegeben werden.")
self.power += chargepoint.data.get.power
self.imported += chargepoint.data.get.imported
elif element["type"] == ComponentType.BAT.value:
Expand Down

0 comments on commit 3c8156b

Please sign in to comment.