Skip to content

Commit

Permalink
remove websocket.id (again) (#344)
Browse files Browse the repository at this point in the history
Co-authored-by: lbbrhzn <@lbbrhzn>
  • Loading branch information
lbbrhzn authored Feb 2, 2022
1 parent 602d247 commit 9debb5f
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions custom_components/ocpp/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,26 +182,20 @@ async def on_connect(
cp_id = cp_id[cp_id.rfind("/") + 1 :]
try:
if self.cpid not in self.charge_points:
_LOGGER.info(
f"Charger {cp_id} connected to {self.host}:{self.port} websocket={websocket.id}."
)
_LOGGER.info(f"Charger {cp_id} connected to {self.host}:{self.port}.")
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} websocket={websocket.id}."
)
_LOGGER.info(f"Charger {cp_id} reconnected to {self.host}:{self.port}.")
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:
_LOGGER.info(
f"Charger {cp_id} disconnected from {self.host}:{self.port} websocket={websocket.id}."
)
_LOGGER.info(f"Charger {cp_id} disconnected from {self.host}:{self.port}.")

def get_metric(self, cp_id: str, measurand: str):
"""Return last known value for given measurand."""
Expand Down

0 comments on commit 9debb5f

Please sign in to comment.