Skip to content

Commit

Permalink
fix add new charge template and vehicle template
Browse files Browse the repository at this point in the history
  • Loading branch information
LKuemmel committed Jan 14, 2025
1 parent a664010 commit 05bcb2a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/helpermodules/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
from control.chargepoint.chargepoint_template import get_autolock_plan_default, get_chargepoint_template_default

# ToDo: move to module commands if implemented
from control.ev.charge_template import get_new_charge_template
from control.ev.ev_template import EvTemplateData
from helpermodules import pub
from helpermodules.abstract_plans import ScheduledChargingPlan, TimeChargingPlan
from helpermodules.utils.run_command import run_command
Expand Down Expand Up @@ -335,7 +337,7 @@ def addChargeTemplate(self, connection_id: str, payload: dict) -> None:
""" sendet das Topic, zu dem ein neues Lade-Profil erstellt werden soll.
"""
new_id = self.max_id_charge_template + 1
charge_template_default = ev.get_new_charge_template()
charge_template_default = get_new_charge_template()
Pub().pub("openWB/set/vehicle/template/charge_template/" +
str(new_id), charge_template_default)
self.max_id_charge_template = new_id
Expand Down Expand Up @@ -487,7 +489,7 @@ def addEvTemplate(self, connection_id: str, payload: dict) -> None:
""" sendet das Topic, zu dem ein neues Fahrzeug-Profil erstellt werden soll.
"""
new_id = self.max_id_ev_template + 1
ev_template_default = dataclass_utils.asdict(ev.EvTemplateData())
ev_template_default = dataclass_utils.asdict(EvTemplateData())
Pub().pub(f'openWB/set/vehicle/template/ev_template/{new_id}', ev_template_default)
self.max_id_ev_template = new_id
Pub().pub("openWB/set/command/max_id/ev_template", new_id)
Expand Down

0 comments on commit 05bcb2a

Please sign in to comment.