test(ocpp-server): add StatusNotification handler
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Tue, 11 Jun 2024 18:46:32 +0000 (20:46 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Tue, 11 Jun 2024 18:46:32 +0000 (20:46 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
tests/ocpp-server/server.py

index e507d4f49b89e73b8087f4d2ecfe3c84fa08e379..2da30d37cea8a4a5a744cf44f30f0a818f38790e 100644 (file)
@@ -40,6 +40,11 @@ class ChargePoint(ocpp.v201.ChargePoint):
         logging.info("Received Heartbeat")
         return ocpp.v201.call_result.Heartbeat(current_time=datetime.now(timezone.utc).isoformat())
 
+    @on(Action.StatusNotification)
+    async def on_status_notification(self, charging_station, connector_id, status, **kwargs):
+        logging.info("Received StatusNotification")
+        return ocpp.v201.call_result.StatusNotification()
+
     # Request handlers to emit OCPP messages.
     async def send_clear_cache(self):
         request = ocpp.v201.call.ClearCache()