From afc6d320ea80c9e9ff4bb77b16718ce24604c092 Mon Sep 17 00:00:00 2001 From: lbbrhzn Date: Mon, 22 Nov 2021 12:13:28 +0100 Subject: [PATCH] fix linting errors (#208) Co-authored-by: lbbrhzn <@lbbrhzn> --- custom_components/ocpp/api.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/custom_components/ocpp/api.py b/custom_components/ocpp/api.py index 11404990..e11fca6d 100644 --- a/custom_components/ocpp/api.py +++ b/custom_components/ocpp/api.py @@ -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: