Fix controller not being stored when setup fails and sequentially fails the retry functionality (#17927)
This commit is contained in:
1 parent
98dfbf2565
commit
b03e6050c5
2 files changed
+7
-6
No files matched your search
@@ -32,20 +32,21 @@ async def async_setup(hass, config):
|
||||
|
||||
async def async_setup_entry(hass, config_entry):
|
||||
"""Set up the UniFi component."""
|
||||
controller = UniFiController(hass, config_entry)
|
||||
|
||||
if DOMAIN not in hass.data:
|
||||
hass.data[DOMAIN] = {}
|
||||
|
||||
controller = UniFiController(hass, config_entry)
|
||||
|
||||
controller_id = CONTROLLER_ID.format(
|
||||
host=config_entry.data[CONF_CONTROLLER][CONF_HOST],
|
||||
site=config_entry.data[CONF_CONTROLLER][CONF_SITE_ID]
|
||||
)
|
||||
|
||||
hass.data[DOMAIN][controller_id] = controller
|
||||
|
||||
if not await controller.async_setup():
|
||||
return False
|
||||
|
||||
hass.data[DOMAIN][controller_id] = controller
|
||||
|
||||
if controller.mac is None:
|
||||
return True
|
||||
|
||||
|
||||
Reference in new issue
Block a user