Skip to content

Commit

Permalink
cp: phase_1 must be 1/2/3
Browse files Browse the repository at this point in the history
  • Loading branch information
LKuemmel committed Jun 4, 2024
1 parent 92f328a commit 8f75c81
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
4 changes: 2 additions & 2 deletions packages/control/chargepoint/chargepoint_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ class Set:
class Config:
configuration: Dict = field(default_factory=empty_dict_factory)
ev: int = 0
name: str = "neuer Ladepunkt"
name: str = "Standard-Ladepunkt"
type: Optional[str] = None
template: int = 0
connected_phases: int = 3
phase_1: int = 0
phase_1: int = 1
auto_phase_switch_hw: bool = False
control_pilot_interruption_hw: bool = False
id: int = 0
Expand Down
2 changes: 1 addition & 1 deletion packages/helpermodules/update_config_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
'openWB/chargepoint/5/get/voltages': b'[230.2,230.2,230.2]',
'openWB/chargepoint/3/get/state_str': b'"Keine Ladung, da kein Auto angesteckt ist."',
'openWB/chargepoint/3/config': (b'{"name": "Standard-Ladepunkt", "type": "mqtt", "ev": 0, "template": 0,'
b'"connected_phases": 3, "phase_1": 0, "auto_phase_switch_hw": false, '
b'"connected_phases": 3, "phase_1": 1, "auto_phase_switch_hw": false, '
b'"control_pilot_interruption_hw": false, "id": 3, "connection_module": '
b'{"type": "mqtt", "name": "MQTT-Ladepunkt", "configuration": {}}, '
b'"power_module": {}}'),
Expand Down
16 changes: 5 additions & 11 deletions packages/modules/common/store/_counter.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,11 @@ def add_exported(element):
for element in elements:
if element["type"] == ComponentType.CHARGEPOINT.value:
chargepoint = data.data.cp_data[f"cp{element['id']}"]
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 der EVU angegeben "
"werden.")

self.currents = list(map(add,
self.currents,
convert_cp_currents_to_evu_currents(
chargepoint.data.config.phase_1,
chargepoint.data.get.currents)))
self.power += chargepoint.data.get.power
self.imported += chargepoint.data.get.imported
elif element["type"] == ComponentType.BAT.value:
Expand Down

0 comments on commit 8f75c81

Please sign in to comment.