From a05446003bd885e5f68d98f4c8cfb8c98c40e548 Mon Sep 17 00:00:00 2001 From: valentin-dimov <143783161+valentin-dimov@users.noreply.github.com> Date: Tue, 5 Dec 2023 11:04:13 +0100 Subject: [PATCH] feat: add on_data_transfer handler to v201 chargepoint (#109) * Fix union annotations for python<3.10 Signed-off-by: Kai-Uwe Hermann --------- Signed-off-by: Valentin Dimov Signed-off-by: Kai-Uwe Hermann Co-authored-by: Kai-Uwe Hermann --- .../core_utils/_configuration/everest_environment_setup.py | 1 + .../core_utils/_configuration/libocpp_configuration_helper.py | 2 ++ .../src/everest/testing/ocpp_utils/central_system.py | 1 + .../src/everest/testing/ocpp_utils/charge_point_v201.py | 4 ++++ 4 files changed, 8 insertions(+) diff --git a/everest-testing/src/everest/testing/core_utils/_configuration/everest_environment_setup.py b/everest-testing/src/everest/testing/core_utils/_configuration/everest_environment_setup.py index de206ac8..4d8280d5 100644 --- a/everest-testing/src/everest/testing/core_utils/_configuration/everest_environment_setup.py +++ b/everest-testing/src/everest/testing/core_utils/_configuration/everest_environment_setup.py @@ -1,5 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 # Copyright 2020 - 2023 Pionix GmbH and Contributors to EVerest +from __future__ import annotations import logging import shutil diff --git a/everest-testing/src/everest/testing/core_utils/_configuration/libocpp_configuration_helper.py b/everest-testing/src/everest/testing/core_utils/_configuration/libocpp_configuration_helper.py index c6aee640..8dd415fb 100644 --- a/everest-testing/src/everest/testing/core_utils/_configuration/libocpp_configuration_helper.py +++ b/everest-testing/src/everest/testing/core_utils/_configuration/libocpp_configuration_helper.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import json import sys from abc import ABC, abstractmethod diff --git a/everest-testing/src/everest/testing/ocpp_utils/central_system.py b/everest-testing/src/everest/testing/ocpp_utils/central_system.py index ea8d4773..873f56dd 100644 --- a/everest-testing/src/everest/testing/ocpp_utils/central_system.py +++ b/everest-testing/src/everest/testing/ocpp_utils/central_system.py @@ -1,5 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 # Copyright 2020 - 2023 Pionix GmbH and Contributors to EVerest +from __future__ import annotations import asyncio import ssl diff --git a/everest-testing/src/everest/testing/ocpp_utils/charge_point_v201.py b/everest-testing/src/everest/testing/ocpp_utils/charge_point_v201.py index 6d86b887..6a4171fb 100644 --- a/everest-testing/src/everest/testing/ocpp_utils/charge_point_v201.py +++ b/everest-testing/src/everest/testing/ocpp_utils/charge_point_v201.py @@ -169,6 +169,10 @@ def on_get_certificate_status(self, **kwargs): return call_result.GetCertificateStatusPayload(status=GenericStatusType.accepted, ocsp_result="") + @on(Action.DataTransfer) + def on_data_transfer(self, **kwargs): + return call_result.DataTransferPayload(status=GenericStatusType.accepted, data="") + async def set_variables_req(self, **kwargs): payload = call.SetVariablesPayload(**kwargs) return await self.call(payload)