diff --git a/iso15118/secc/controller/interface.py b/iso15118/secc/controller/interface.py index b71cf1b0..3a710005 100644 --- a/iso15118/secc/controller/interface.py +++ b/iso15118/secc/controller/interface.py @@ -1063,3 +1063,18 @@ async def send_display_params(self): Share display params with CS. """ 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 d9dcaf02..6bbc1c7f 100644 --- a/iso15118/secc/controller/simulator.py +++ b/iso15118/secc/controller/simulator.py @@ -1096,3 +1096,9 @@ async def send_display_params(self): Share display params with CS. """ logger.info("Send display params to CS.") + + async def send_rated_limits(self): + """ + Overrides EVSEControllerInterface.send_rated_limits + """ + logger.info("Send rated limits to CS.") diff --git a/iso15118/secc/states/din_spec_states.py b/iso15118/secc/states/din_spec_states.py index 9fc13b3c..5c518b91 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 42423280..a354451f 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 ced5561f..5a0cae7a 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 diff --git a/tests/shared/messages/test_interface.py b/tests/shared/messages/test_interface.py index 2805e9d4..ecddb00b 100644 --- a/tests/shared/messages/test_interface.py +++ b/tests/shared/messages/test_interface.py @@ -143,6 +143,9 @@ async def session_ended(self, _): async def send_display_params(self): pass + async def send_rated_limits(self): + pass + @pytest.fixture def evse_controller_interface():