[autofix.ci] apply automated fixes
authorautofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Thu, 27 Jun 2024 07:20:15 +0000 (07:20 +0000)
committerGitHub <noreply@github.com>
Thu, 27 Jun 2024 07:20:15 +0000 (07:20 +0000)
tests/ocpp-server/server.py

index 5738c7e33ce778fcf401c1bdb7ac501f9944c3d1..c8bdd0851ab2cfee8a5bc0a1e696eecf26934356 100644 (file)
@@ -2,7 +2,6 @@ import argparse
 import asyncio
 import logging
 from datetime import datetime, timezone
-from functools import partial
 from threading import Timer
 
 import ocpp.v201
@@ -127,7 +126,6 @@ class ChargePoint(ocpp.v201.ChargePoint):
             logging.info("%s filed", Action.GetBaseReport)
 
 
-
 # Function to send OCPP command
 async def send_ocpp_command(cp, command_name, delay=None, period=None):
     try:
@@ -147,7 +145,9 @@ async def send_ocpp_command(cp, command_name, delay=None, period=None):
         await asyncio.sleep(delay)
 
     if period:
-        my_timer = RepeatTimer(period, asyncio.create_task, [cp.send_ocpp_command(command_name)])
+        my_timer = RepeatTimer(
+            period, asyncio.create_task, [cp.send_ocpp_command(command_name)]
+        )
         my_timer.start()
 
 
@@ -184,6 +184,7 @@ async def on_connect(websocket, path):
         ChargePoints.remove(cp)
         logging.debug("Connected ChargePoint(s): %d", len(ChargePoints))
 
+
 # Main function to start the WebSocket server.
 async def main():
     # Define argument parser
@@ -192,7 +193,6 @@ async def main():
     parser.add_argument("--delay", type=int, help="Delay in seconds")
     parser.add_argument("--period", type=int, help="Period in seconds")
 
-
     # Create the WebSocket server and specify the handler for new connections.
     server = await websockets.serve(
         on_connect,
@@ -208,7 +208,7 @@ async def main():
         for cp in ChargePoints:
             asyncio.create_task(
                 send_ocpp_command(cp, args.command, args.delay, args.period)
-                )
+            )
 
     # Wait for the server to close (runs indefinitely).
     await server.wait_closed()