From 8430af0a8ef88806725ab72613f0d2385798e182 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 12 Jun 2024 00:13:50 +0200 Subject: [PATCH] refactor(ocpp-server): code formatting 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 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/ocpp-server/server.py b/tests/ocpp-server/server.py index c8748763..02e3a96f 100644 --- a/tests/ocpp-server/server.py +++ b/tests/ocpp-server/server.py @@ -52,7 +52,8 @@ class ChargePoint(ocpp.v201.ChargePoint): async def on_authorize(self, id_token, **kwargs): logging.info("Received Authorize") return ocpp.v201.call_result.Authorize( - id_token_info={'status': AuthorizationStatusType.accepted}) + id_token_info={'status': AuthorizationStatusType.accepted} + ) @on(Action.TransactionEvent) async def on_transaction_event(self, event_type, timestamp, trigger_reason, seq_no, @@ -61,11 +62,13 @@ class ChargePoint(ocpp.v201.ChargePoint): case TransactionEventType.started: logging.info("Received TransactionEvent Started") return ocpp.v201.call_result.TransactionEvent( - id_token_info={'status': AuthorizationStatusType.accepted}) + id_token_info={'status': AuthorizationStatusType.accepted} + ) case TransactionEventType.updated: logging.info("Received TransactionEvent Updated") return ocpp.v201.call_result.TransactionEvent( - total_cost=10) + total_cost=10 + ) case TransactionEventType.ended: logging.info("Received TransactionEvent Ended") return ocpp.v201.call_result.TransactionEvent() @@ -102,7 +105,8 @@ async def on_connect(websocket, path): logging.warning('Protocols Mismatched | Expected Subprotocols: %s,' ' but client supports %s | Closing connection', websocket.available_subprotocols, - requested_protocols) + requested_protocols + ) return await websocket.close() charge_point_id = path.strip('/') -- 2.34.1