Closed
Description
If the following configuration parameter is missing:
homeassistant::
endpoint: "/api/websocket"
We have the error:
2025-01-15 18:43:52 ERROR [gazpar2haws.__main__] An error occured while running Gazpar2HAWS: Traceback (most recent call last):
File "c:\Users\steph\Qsync\Workspace\Python\gazpar2haws\gazpar2haws\__main__.py", line 87, in main
await bridge.run()
File "c:\Users\steph\Qsync\Workspace\Python\gazpar2haws\gazpar2haws\bridge.py", line 59, in run
await self._homeassistant.connect()
File "c:\Users\steph\Qsync\Workspace\Python\gazpar2haws\gazpar2haws\haws.py", line 34, in connect
self._websocket = await websockets.connect(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\steph\Qsync\Workspace\Python\gazpar2haws\.venv\Lib\site-packages\websockets\asyncio\client.py", line 442, in __await_impl__
self.connection = await self.create_connection()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\steph\Qsync\Workspace\Python\gazpar2haws\.venv\Lib\site-packages\websockets\asyncio\client.py", line 347, in create_connection
wsuri = parse_uri(self.uri)
^^^^^^^^^^^^^^^^^^^
File "c:\Users\steph\Qsync\Workspace\Python\gazpar2haws\.venv\Lib\site-packages\websockets\uri.py", line 84, in parse_uri
port = parsed.port or (443 if secure else 80)
^^^^^^^^^^^
File "C:\Program Files\Python312\Lib\urllib\parse.py", line 182, in port
raise ValueError(f"Port could not be cast to integer value as {port!r}")
ValueError: Port could not be cast to integer value as '6123None'
We don't want that and have to set a default value for that missing parameter.