mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Move lutron_caseta migration to happen after successful setup (#75204)
This commit is contained in:
parent
fde3489e86
commit
5f08052f40
@ -143,8 +143,6 @@ async def async_setup_entry(
|
|||||||
ca_certs = hass.config.path(config_entry.data[CONF_CA_CERTS])
|
ca_certs = hass.config.path(config_entry.data[CONF_CA_CERTS])
|
||||||
bridge = None
|
bridge = None
|
||||||
|
|
||||||
await _async_migrate_unique_ids(hass, config_entry)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
bridge = Smartbridge.create_tls(
|
bridge = Smartbridge.create_tls(
|
||||||
hostname=host, keyfile=keyfile, certfile=certfile, ca_certs=ca_certs
|
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}")
|
raise ConfigEntryNotReady(f"Cannot connect to {host}")
|
||||||
|
|
||||||
_LOGGER.debug("Connected to Lutron Caseta bridge via LEAP at %s", 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()
|
devices = bridge.get_devices()
|
||||||
bridge_device = devices[BRIDGE_DEVICE_ID]
|
bridge_device = devices[BRIDGE_DEVICE_ID]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user