diff --git a/homeassistant/components/daikin/__init__.py b/homeassistant/components/daikin/__init__.py index 2df831eb6dbed541e91812f9e6e95b1a55714852..8e96ccb87388a9f7038b3fb6d64d021ea4c4331e 100644 --- a/homeassistant/components/daikin/__init__.py +++ b/homeassistant/components/daikin/__init__.py @@ -9,6 +9,7 @@ import voluptuous as vol from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry from homeassistant.const import CONF_HOST, CONF_HOSTS +from homeassistant.exceptions import ConfigEntryNotReady import homeassistant.helpers.config_validation as cv from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC from homeassistant.helpers.typing import HomeAssistantType @@ -88,17 +89,17 @@ async def daikin_api_setup(hass, host): from pydaikin.appliance import Appliance session = hass.helpers.aiohttp_client.async_get_clientsession() try: - with timeout(10, loop=hass.loop): + with timeout(10): device = Appliance(host, session) await device.init() except asyncio.TimeoutError: - _LOGGER.error("Connection to Daikin timeout") - return None + _LOGGER.debug("Connection to %s timed out", host) + raise ConfigEntryNotReady except ClientConnectionError: - _LOGGER.error("ServerDisconected") - return None + _LOGGER.debug("ClientConnectionError to %s", host) + raise ConfigEntryNotReady except Exception: # pylint: disable=broad-except - _LOGGER.error("Unexpected error creating device") + _LOGGER.error("Unexpected error creating device %s", host) return None api = DaikinApi(device)