Skip to content

Commit 602d247

Browse files
author
lbbrhzn
authored
Remove websocket.id (#343)
* improve reconnect and trigger boot notification * cancel tasks on close and reconnect * improve exception handling * remove websocket.id from logs Co-authored-by: lbbrhzn <@lbbrhzn>
1 parent 44c72a3 commit 602d247

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

custom_components/ocpp/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -856,14 +856,14 @@ async def stop(self):
856856
"""Close connection and cancel ongoing tasks."""
857857
self.status = STATE_UNAVAILABLE
858858
if self._connection.open:
859-
_LOGGER.debug(f"Closing websocket: '{self._connection.id}'")
859+
_LOGGER.debug(f"Closing websocket to '{self.id}'")
860860
await self._connection.close()
861861
for task in self.tasks:
862862
task.cancel()
863863

864864
async def reconnect(self, connection: websockets.server.WebSocketServerProtocol):
865865
"""Reconnect charge point."""
866-
_LOGGER.debug(f"Reconnect {connection.id}")
866+
_LOGGER.debug(f"Reconnect websocket to {self.id}")
867867

868868
await self.stop()
869869
self.status = STATE_OK

0 commit comments

Comments
 (0)