diff --git a/custom_components/huesyncbox/__init__.py b/custom_components/huesyncbox/__init__.py index cd41c15..c8e2b7c 100644 --- a/custom_components/huesyncbox/__init__.py +++ b/custom_components/huesyncbox/__init__.py @@ -6,7 +6,7 @@ from homeassistant.config_entries import ConfigEntry from homeassistant.const import Platform from homeassistant.core import HomeAssistant -from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryError +from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady from homeassistant.helpers import ( entity_registry, ) @@ -47,7 +47,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: except aiohuesyncbox.Unauthorized as err: raise ConfigEntryAuthFailed(err) from err except aiohuesyncbox.RequestError as err: - raise ConfigEntryError(err) from err + raise ConfigEntryNotReady(err) from err finally: if not initialized: await api.close() diff --git a/tests/test_init.py b/tests/test_init.py index b4c45e7..9758841 100644 --- a/tests/test_init.py +++ b/tests/test_init.py @@ -53,7 +53,7 @@ async def test_handle_communication_error_during_setup(hass: HomeAssistant, mock config_entry = hass.config_entries.async_get_entry(integration.entry.entry_id) assert config_entry is not None - assert config_entry.state == ConfigEntryState.SETUP_ERROR + assert config_entry.state == ConfigEntryState.SETUP_RETRY assert mock_api.close.call_count == 1