Skip to content

Commit

Permalink
add timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
bj00rn committed Feb 9, 2023
1 parent d8d112b commit bd56ce6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion custom_components/saleryd_hrv/config_flow.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Adds config flow for SalerydLoke."""
import logging
import asyncio

from homeassistant import config_entries
from homeassistant.helpers.aiohttp_client import async_create_clientsession
Expand Down Expand Up @@ -86,7 +87,7 @@ async def _test_connection(self, ip, port):
try:
session = async_create_clientsession(self.hass)
client = Client(ip, port, session)
await client.connect()
asyncio.wait_for(client.connect(), 10)
return True
except Exception as e: # pylint: disable=broad-except
_LOGGER.error("Could not connect", exc_info=True)
Expand Down

0 comments on commit bd56ce6

Please sign in to comment.