Skip to content

Commit

Permalink
fix linting errors (#208)
Browse files Browse the repository at this point in the history
Co-authored-by: lbbrhzn <@lbbrhzn>
  • Loading branch information
lbbrhzn authored Nov 22, 2021
1 parent 7736d78 commit afc6d32
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions custom_components/ocpp/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,15 @@ async def on_connect(self, websocket, path: str):
try:
if self.cpid not in self.charge_points:
_LOGGER.info(f"Charger {cp_id} connected to {self.host}:{self.port}.")
cp = ChargePoint(cp_id, websocket, self.hass, self.entry, self)
self.charge_points[self.cpid] = cp
await self.charge_points[self.cpid].start()
charge_point = ChargePoint(
cp_id, websocket, self.hass, self.entry, self
)
self.charge_points[self.cpid] = charge_point
await charge_point.start()
else:
_LOGGER.info(f"Charger {cp_id} reconnected to {self.host}:{self.port}.")
cp = self.charge_points[self.cpid]
await self.charge_points[self.cpid].reconnect(websocket)
charge_point: ChargePoint = self.charge_points[self.cpid]
await charge_point.reconnect(websocket)
except Exception as e:
_LOGGER.error(f"Exception occurred:\n{e}", exc_info=True)
finally:
Expand Down

0 comments on commit afc6d32

Please sign in to comment.