Skip to content

Commit

Permalink
remove websocket dep warning (#1377)
Browse files Browse the repository at this point in the history
  • Loading branch information
drc38 authored Oct 31, 2024
1 parent 3342f86 commit 32ab437
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions custom_components/ocpp/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,7 @@ async def create(hass: HomeAssistant, entry: ConfigEntry):
self._server = server
return self

async def on_connect(
self, websocket: websockets.server.WebSocketServerProtocol, path: str
):
async def on_connect(self, websocket: websockets.server.WebSocketServerProtocol):
"""Request handler executed for every new OCPP connection."""
if self.config.get(CONF_SKIP_SCHEMA_VALIDATION, DEFAULT_SKIP_SCHEMA_VALIDATION):
_LOGGER.warning("Skipping websocket subprotocol validation")
Expand All @@ -240,8 +238,8 @@ async def on_connect(
)
return await websocket.close()

_LOGGER.info(f"Charger websocket path={path}")
cp_id = path.strip("/")
_LOGGER.info(f"Charger websocket path={websocket.path}")
cp_id = websocket.path.strip("/")
cp_id = cp_id[cp_id.rfind("/") + 1 :]
if self.cpid not in self.charge_points:
_LOGGER.info(f"Charger {cp_id} connected to {self.host}:{self.port}.")
Expand Down

0 comments on commit 32ab437

Please sign in to comment.