planbnet/livisi_unofficial

Error setting up entry SHC Classic for livisi

Closed this issue · 2 comments

System Health details

a new Error in SHC1

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

Describe the issue

after update to 2.4 it will not setting up

downgrade to 2.3.2 work (buggy but load partially)

Reproduction steps

  1. have just livisi unofficial update to 2.4
  2. reboot

...

fyi: after HA 9.0 livisi official will stop working.

Debug logs

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: homeassistant.config_entries
Source: custom_components/livisi/livisi_connector.py:167
Integration: Livisi Unofficial
First occurred: 21:18:16 (2 occurrences)
Last logged: 21:25:09

Error setting up entry SHC Classic for livisi
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 388, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/livisi/__init__.py", line 33, in async_setup_entry
    await coordinator.async_setup()
  File "/config/custom_components/livisi/coordinator.py", line 69, in async_setup
    self.aiolivisi = await livisi_connect(
                     ^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/livisi/livisi_connector.py", line 38, in connect
    await connection.connect(host, password)
  File "/config/custom_components/livisi/livisi_connector.py", line 66, in connect
    self.controller = await self._async_get_controller()
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/livisi/livisi_connector.py", line 180, in _async_get_controller
    shc_info = await self.async_send_authorized_request("get", path="status")
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/livisi/livisi_connector.py", line 101, in async_send_authorized_request
    return await self._async_send_request(method, url, payload, auth_headers)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/livisi/livisi_connector.py", line 167, in _async_send_request
    async with self._web_session.request(
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 1141, in __aenter__
    self._resp = await self._coro
                 ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 560, in _request
    await resp.start(conn)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 899, in start
    message, payload = await protocol.read()  # type: ignore[union-attr]
                       ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/streams.py", line 616, in read
    await self._waiter
aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected

Diagnostics dump

No response

I think I found and fixed the problem. After the 1.4.0 rewrite it was obvious. The stupid workaround with just trying again could also be removed by simply telling the connector to close the connection after every request.
So it wasn't a parallel requests but consecutive requests on the same connection that SHV v1 couldn't handle.

yes, its fixed.... it seems, the other Problems are now gone too i think. I will test it in the next days