Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
drc38 authored and jainmohit2001 committed Oct 15, 2024
1 parent c4bc69c commit c30300e
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 @@ -296,10 +296,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 @@ -348,10 +345,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 @@ -422,10 +416,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 @@ -450,10 +441,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 c30300e

Please sign in to comment.