From d776d54ca7bf44698bb8c3fb09c76940965b86e8 Mon Sep 17 00:00:00 2001 From: ikaratass <89934937+ikaratass@users.noreply.github.com> Date: Wed, 27 Mar 2024 19:24:58 +0000 Subject: [PATCH] current types are set --- iso15118/secc/states/din_spec_states.py | 3 ++- iso15118/secc/states/iso15118_20_states.py | 10 +++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/iso15118/secc/states/din_spec_states.py b/iso15118/secc/states/din_spec_states.py index 1146367f..1ed2119c 100644 --- a/iso15118/secc/states/din_spec_states.py +++ b/iso15118/secc/states/din_spec_states.py @@ -10,6 +10,7 @@ from typing import Optional, Type, Union from iso15118.secc.comm_session_handler import SECCCommunicationSession +from iso15118.secc.controller.evse_data import CurrentType from iso15118.secc.states.secc_state import StateSECC from iso15118.shared.messages.app_protocol import ( SupportedAppProtocolReq, @@ -395,7 +396,7 @@ async def process_message( dc_evse_charge_params = ( await self.comm_session.evse_controller.get_dc_charge_parameters_dinspec() # noqa ) - evse_data_context.update_dc_charge_parameters(dc_evse_charge_params) + evse_data_context.current_type = CurrentType.DC sa_schedule_list = ( await self.comm_session.evse_controller.get_sa_schedule_list_dinspec( diff --git a/iso15118/secc/states/iso15118_20_states.py b/iso15118/secc/states/iso15118_20_states.py index 1d538422..f86b3e5c 100644 --- a/iso15118/secc/states/iso15118_20_states.py +++ b/iso15118/secc/states/iso15118_20_states.py @@ -10,7 +10,7 @@ from iso15118.secc.comm_session_handler import SECCCommunicationSession from iso15118.secc.controller.common import UnknownEnergyService -from iso15118.secc.controller.evse_data import EVSEDataContext +from iso15118.secc.controller.evse_data import EVSEDataContext, CurrentType from iso15118.secc.states.secc_state import StateSECC from iso15118.shared.exi_codec import EXI from iso15118.shared.messages.app_protocol import ( @@ -1350,10 +1350,8 @@ async def process_message( ev_data_context.update_ac_charge_parameters_v20(energy_service, ac_cpd_req) evse_data_context = ( self.comm_session.evse_controller.evse_data_context - ) = EVSEDataContext() - evse_data_context.update_ac_charge_parameters_v20( - energy_service, ac_cpd_res ) + evse_data_context.current_type = CurrentType.AC except UnknownEnergyService: self.stop_state_machine( f"Invalid charge parameter for service {energy_service}", @@ -1548,9 +1546,7 @@ async def process_message( ev_data_context = self.comm_session.evse_controller.ev_data_context ev_data_context.update_dc_charge_parameters_v20(energy_service, dc_cpd_req) evse_data_context = self.comm_session.evse_controller.evse_data_context - evse_data_context.update_dc_charge_parameters_v20( - energy_service, dc_cpd_res - ) + evse_data_context.current_type = CurrentType.DC except UnknownEnergyService: self.stop_state_machine( f"Invalid charge parameter for service {energy_service}",