From 5071b3b95937d9c940269bd6e9f58e0518f5aa55 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Wed, 26 Jan 2022 20:07:10 +0100 Subject: [PATCH] Abort rachio config entry setup when not connected to cloud (#64975) --- homeassistant/components/rachio/__init__.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/rachio/__init__.py b/homeassistant/components/rachio/__init__.py index eafb8ee25ba..ea8b8fe59cb 100644 --- a/homeassistant/components/rachio/__init__.py +++ b/homeassistant/components/rachio/__init__.py @@ -58,9 +58,14 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: # Get the URL of this server rachio.webhook_auth = secrets.token_hex() - webhook_id, webhook_url = await async_get_or_create_registered_webhook_id_and_url( - hass, entry - ) + try: + ( + webhook_id, + webhook_url, + ) = await async_get_or_create_registered_webhook_id_and_url(hass, entry) + except cloud.CloudNotConnected as exc: + # User has an active cloud subscription, but the connection to the cloud is down + raise ConfigEntryNotReady from exc rachio.webhook_url = webhook_url person = RachioPerson(rachio, entry)