fix(ocpp-server): randomize GetBaseReport request id
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Tue, 2 Jul 2024 20:10:29 +0000 (22:10 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Tue, 2 Jul 2024 20:10:29 +0000 (22:10 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
tests/ocpp-server/server.py

index 483c750f20dd79fa56c0a15d3a8dbb0fb841459a..17e328a661ee459ce421c768f0501e71effe537e 100644 (file)
@@ -3,6 +3,7 @@ import asyncio
 import logging
 from datetime import datetime, timezone
 from functools import partial
+from random import randint
 from typing import Optional
 
 import ocpp.v201
@@ -108,7 +109,8 @@ class ChargePoint(ocpp.v201.ChargePoint):
 
     async def _send_get_base_report(self):
         request = ocpp.v201.call.GetBaseReport(
-            request_id=1, report_base=ReportBaseType.full_inventory
+            request_id=randint(1, 100),  # noqa: S311
+            report_base=ReportBaseType.full_inventory,
         )
         response = await self.call(request)