diff --git a/iso15118/secc/controller/interface.py b/iso15118/secc/controller/interface.py index db5bf516..3d7f2074 100644 --- a/iso15118/secc/controller/interface.py +++ b/iso15118/secc/controller/interface.py @@ -1056,3 +1056,18 @@ async def session_ended(self, current_state: str, reason: str): Indicate the reason for stopping charging. """ raise NotImplementedError + + @abstractmethod + async def send_rated_limits(self): + """ + This method is called in the state ChargeParameterDiscovery state for all + protocols. + The message is used to share the physical limitations of the EV (perhaps + for this session alone) with the charging station. + + Relevant for: + - DIN SPEC 70121 + - ISO 15118-2 + - ISO 15118-20 + """ + raise NotImplementedError diff --git a/iso15118/secc/controller/simulator.py b/iso15118/secc/controller/simulator.py index f85b62a9..2c218a06 100644 --- a/iso15118/secc/controller/simulator.py +++ b/iso15118/secc/controller/simulator.py @@ -1090,3 +1090,9 @@ async def session_ended(self, current_state: str, reason: str): @param last_message: The last message that was either sent/received. """ logger.info(f"Session ended in {current_state} ({reason}).") + + async def send_rated_limits(self): + """ + Overrides EVSEControllerInterface.send_rated_limits + """ + pass diff --git a/iso15118/secc/states/din_spec_states.py b/iso15118/secc/states/din_spec_states.py index 0300f0f3..d623be89 100644 --- a/iso15118/secc/states/din_spec_states.py +++ b/iso15118/secc/states/din_spec_states.py @@ -392,7 +392,7 @@ async def process_message( ev_data_context.update_dc_charge_parameters( charge_parameter_discovery_req.dc_ev_charge_parameter ) - + await self.comm_session.evse_controller.send_rated_limits() dc_evse_charge_params = ( await self.comm_session.evse_controller.get_dc_charge_parameters_dinspec() # noqa ) diff --git a/iso15118/secc/states/iso15118_20_states.py b/iso15118/secc/states/iso15118_20_states.py index 4b71355e..90949d58 100644 --- a/iso15118/secc/states/iso15118_20_states.py +++ b/iso15118/secc/states/iso15118_20_states.py @@ -1350,6 +1350,7 @@ 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 evse_data_context.current_type = CurrentType.AC + await self.comm_session.evse_controller.send_rated_limits() except UnknownEnergyService: self.stop_state_machine( f"Invalid charge parameter for service {energy_service}", @@ -1545,6 +1546,7 @@ async def process_message( 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.current_type = CurrentType.DC + await self.comm_session.evse_controller.send_rated_limits() except UnknownEnergyService: self.stop_state_machine( f"Invalid charge parameter for service {energy_service}", diff --git a/iso15118/secc/states/iso15118_2_states.py b/iso15118/secc/states/iso15118_2_states.py index ae5b165a..6f1c35b0 100644 --- a/iso15118/secc/states/iso15118_2_states.py +++ b/iso15118/secc/states/iso15118_2_states.py @@ -1379,6 +1379,7 @@ async def process_message( ev_data_context.update_dc_charge_parameters( charge_params_req.dc_ev_charge_parameter ) + await self.comm_session.evse_controller.send_rated_limits() departure_time = ( ev_data_context.departure_time if ev_data_context.departure_time else 0