From b629b3d99a8f45a8e9f8079f4c91e24329a897d4 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 16 Apr 2022 00:12:16 -1000 Subject: [PATCH] Ensure powerwall retries setup when api returns too many requests (#70143) --- homeassistant/components/powerwall/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/homeassistant/components/powerwall/__init__.py b/homeassistant/components/powerwall/__init__.py index 6537ea249c1..af75ace8bd4 100644 --- a/homeassistant/components/powerwall/__init__.py +++ b/homeassistant/components/powerwall/__init__.py @@ -162,6 +162,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: _LOGGER.debug("Authentication failed", exc_info=err) http_session.close() raise ConfigEntryAuthFailed from err + except APIError as err: + http_session.close() + raise ConfigEntryNotReady from err gateway_din = base_info.gateway_din if gateway_din and entry.unique_id is not None and is_ip_address(entry.unique_id):