Skip to content

Commit 41da0ad

Browse files
authored
Merge pull request #2151 from openWB/master
fix add new charge template and vehicle template (#2150)
2 parents b4359d4 + f46779d commit 41da0ad

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/helpermodules/command.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
from control.chargepoint.chargepoint_template import get_autolock_plan_default, get_chargepoint_template_default
1717

1818
# ToDo: move to module commands if implemented
19+
from control.ev.charge_template import get_new_charge_template
20+
from control.ev.ev_template import EvTemplateData
1921
from helpermodules import pub
2022
from helpermodules.abstract_plans import ScheduledChargingPlan, TimeChargingPlan
2123
from helpermodules.utils.run_command import run_command
@@ -335,7 +337,7 @@ def addChargeTemplate(self, connection_id: str, payload: dict) -> None:
335337
""" sendet das Topic, zu dem ein neues Lade-Profil erstellt werden soll.
336338
"""
337339
new_id = self.max_id_charge_template + 1
338-
charge_template_default = ev.get_new_charge_template()
340+
charge_template_default = get_new_charge_template()
339341
Pub().pub("openWB/set/vehicle/template/charge_template/" +
340342
str(new_id), charge_template_default)
341343
self.max_id_charge_template = new_id
@@ -487,7 +489,7 @@ def addEvTemplate(self, connection_id: str, payload: dict) -> None:
487489
""" sendet das Topic, zu dem ein neues Fahrzeug-Profil erstellt werden soll.
488490
"""
489491
new_id = self.max_id_ev_template + 1
490-
ev_template_default = dataclass_utils.asdict(ev.EvTemplateData())
492+
ev_template_default = dataclass_utils.asdict(EvTemplateData())
491493
Pub().pub(f'openWB/set/vehicle/template/ev_template/{new_id}', ev_template_default)
492494
self.max_id_ev_template = new_id
493495
Pub().pub("openWB/set/command/max_id/ev_template", new_id)

0 commit comments

Comments
 (0)