ZacheryThomas / homeassistant-smartrent

Home Assistant Custom Component for SmartRent Locks ๐Ÿ”, Thermostats ๐ŸŒก, Sensors ๐Ÿ’ง and Switches๐Ÿ’ก
MIT License
84 stars 3 forks source link

Initialization issue HAOS #19

Closed Evanito closed 1 year ago

Evanito commented 1 year ago

Hello, thanks for the service ๐Ÿ˜ƒ after restarting HAOS today, I am getting the following error: Have not tried anything to resolve (such as re-logging in), sending you the error log in case it is something you can add an automatic fix for.

Home Assistant 2023.6.3
Supervisor 2023.06.2
Operating System 10.3
Frontend 20230608.0 - latest
2023-06-27 00:02:36.211 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: smartrent
2023-06-27 00:02:44.530 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry (myemail)@gmail.com for smartrent
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartrent/__init__.py", line 43, in async_setup_entry
    api = await async_login(username, password, session, tfa_token=tfa_token)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/smartrent/api.py", line 162, in async_login
    await smart_rent_api.async_fetch_devices()
  File "/usr/local/lib/python3.11/site-packages/smartrent/api.py", line 48, in async_fetch_devices
    data = await self.client.async_get_devices_data()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/smartrent/utils.py", line 121, in async_get_devices_data
    res = await self._async_get_devices_data()
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/smartrent/utils.py", line 135, in _async_get_devices_data
    hubs_resp = await self._aiohttp_session.get(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 536, in _request
    conn = await self._connector.connect(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 540, in connect
    proto = await self._create_connection(req, traces, timeout)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 901, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 980, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore[return-value]  # noqa
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1069, in create_connection
    sock = await self._connect_sock(
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 973, in _connect_sock
    await self.sock_connect(sock, address)
  File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 634, in sock_connect
    return await fut
           ^^^^^^^^^
asyncio.exceptions.CancelledError
Evanito commented 1 year ago

My SmartRent hub was offline, and this was solved by power cycling the hub. Don't believe this is an issue with the integration. Thanks!