From 5f08052f40b1d1eca574ec546b5d8acb33a148fc Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 14 Jul 2022 20:48:30 +0200 Subject: [PATCH] Move lutron_caseta migration to happen after successful setup (#75204) --- homeassistant/components/lutron_caseta/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/homeassistant/components/lutron_caseta/__init__.py b/homeassistant/components/lutron_caseta/__init__.py index cea069a1556..d235f294b3a 100644 --- a/homeassistant/components/lutron_caseta/__init__.py +++ b/homeassistant/components/lutron_caseta/__init__.py @@ -143,8 +143,6 @@ async def async_setup_entry( ca_certs = hass.config.path(config_entry.data[CONF_CA_CERTS]) bridge = None - await _async_migrate_unique_ids(hass, config_entry) - try: bridge = Smartbridge.create_tls( hostname=host, keyfile=keyfile, certfile=certfile, ca_certs=ca_certs @@ -167,6 +165,7 @@ async def async_setup_entry( raise ConfigEntryNotReady(f"Cannot connect to {host}") _LOGGER.debug("Connected to Lutron Caseta bridge via LEAP at %s", host) + await _async_migrate_unique_ids(hass, config_entry) devices = bridge.get_devices() bridge_device = devices[BRIDGE_DEVICE_ID]