Abort rachio config entry setup when not connected to cloud (#64975)

This commit is contained in:
Erik Montnemery 2022-01-26 20:07:10 +01:00 committed by GitHub
parent d4497e4b68
commit 5071b3b959
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)