Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
drc38 authored Jun 24, 2024
1 parent 273202b commit 5cd8621
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions ocpp/charge_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,7 @@ async def _handle_call(self, msg):

if not handlers.get("_skip_schema_validation", False):
await asyncio.get_event_loop().run_in_executor(
None,
validate_payload,
msg,
self._ocpp_version
None, validate_payload, msg, self._ocpp_version
)
# OCPP uses camelCase for the keys in the payload. It's more pythonic
# to use snake_case for keyword arguments. Therefore the keys must be
Expand Down Expand Up @@ -343,10 +340,7 @@ async def _handle_call(self, msg):

if not handlers.get("_skip_schema_validation", False):
await asyncio.get_event_loop().run_in_executor(
None,
validate_payload,
response,
self._ocpp_version
None, validate_payload, response, self._ocpp_version
)

await self._send(response.to_json())
Expand Down Expand Up @@ -417,10 +411,7 @@ async def call(

if not skip_schema_validation:
await asyncio.get_event_loop().run_in_executor(
None,
validate_payload,
call,
self._ocpp_version
None, validate_payload, call, self._ocpp_version
)

# Use a lock to prevent make sure that only 1 message can be send at a
Expand All @@ -445,10 +436,7 @@ async def call(
elif not skip_schema_validation:
response.action = call.action
await asyncio.get_event_loop().run_in_executor(
None,
validate_payload,
response,
self._ocpp_version
None, validate_payload, response, self._ocpp_version
)

snake_case_payload = camel_to_snake_case(response.payload)
Expand Down

0 comments on commit 5cd8621

Please sign in to comment.