From: Jérôme Benoit Date: Tue, 11 Jun 2024 18:40:05 +0000 (+0200) Subject: test(ocpp-server): add heartbeart command handler X-Git-Tag: v1.3.7~75 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=115f3b177307e3a152a556db843653a499a5fe4c;hp=339f65ad177a26f0c75dab3da066638ffcd7c44d;p=e-mobility-charging-stations-simulator.git test(ocpp-server): add heartbeart command handler Signed-off-by: Jérôme Benoit --- 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()