From 115f3b177307e3a152a556db843653a499a5fe4c Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 11 Jun 2024 20:40:05 +0200 Subject: [PATCH] test(ocpp-server): add heartbeart command handler MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- tests/ocpp-server/server.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/ocpp-server/server.py b/tests/ocpp-server/server.py index 308994ed..e507d4f4 100644 --- a/tests/ocpp-server/server.py +++ b/tests/ocpp-server/server.py @@ -31,10 +31,15 @@ class ChargePoint(ocpp.v201.ChargePoint): # an interval of 10 seconds, and an accepted status. return ocpp.v201.call_result.BootNotification( current_time=datetime.now(timezone.utc).isoformat(), - interval=10, + interval=60, status=RegistrationStatusType.accepted ) + @on(Action.Heartbeat) + async def on_heartbeat(self, charging_station, **kwargs): + logging.info("Received Heartbeat") + return ocpp.v201.call_result.Heartbeat(current_time=datetime.now(timezone.utc).isoformat()) + # Request handlers to emit OCPP messages. async def send_clear_cache(self): request = ocpp.v201.call.ClearCache() -- 2.34.1