Skip to content

Commit f928173

Browse files
author
lbbrhzn
committed
fix linting errors
1 parent 5f6b662 commit f928173

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

custom_components/ocpp/api.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,15 @@ async def on_connect(self, websocket, path: str):
173173
try:
174174
if self.cpid not in self.charge_points:
175175
_LOGGER.info(f"Charger {cp_id} connected to {self.host}:{self.port}.")
176-
cp = ChargePoint(cp_id, websocket, self.hass, self.entry, self)
177-
self.charge_points[self.cpid] = cp
178-
await self.charge_points[self.cpid].start()
176+
charge_point = ChargePoint(
177+
cp_id, websocket, self.hass, self.entry, self
178+
)
179+
self.charge_points[self.cpid] = charge_point
180+
await charge_point.start()
179181
else:
180182
_LOGGER.info(f"Charger {cp_id} reconnected to {self.host}:{self.port}.")
181-
cp = self.charge_points[self.cpid]
182-
await self.charge_points[self.cpid].reconnect(websocket)
183+
charge_point: ChargePoint = self.charge_points[self.cpid]
184+
await charge_point.reconnect(websocket)
183185
except Exception as e:
184186
_LOGGER.error(f"Exception occurred:\n{e}", exc_info=True)
185187
finally:

0 commit comments

Comments
 (0)