From b722a7e05bcee74f4d3c1191c9caa5f923371441 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 17 Jan 2023 11:51:04 -1000 Subject: [PATCH] Ensure flux_led does not try to reload while setup is in progress (#86122) There was a discovery race in flux_led that could trigger it to try to reload while in progress if the device data changed --- homeassistant/components/flux_led/config_flow.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/flux_led/config_flow.py b/homeassistant/components/flux_led/config_flow.py index b245c0c2bc2..4baebda516e 100644 --- a/homeassistant/components/flux_led/config_flow.py +++ b/homeassistant/components/flux_led/config_flow.py @@ -121,8 +121,12 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): async_update_entry_from_discovery( self.hass, entry, device, None, allow_update_mac ) - or entry.state == config_entries.ConfigEntryState.SETUP_RETRY - ): + and entry.state + not in ( + config_entries.ConfigEntryState.SETUP_IN_PROGRESS, + config_entries.ConfigEntryState.NOT_LOADED, + ) + ) or entry.state == config_entries.ConfigEntryState.SETUP_RETRY: self.hass.async_create_task( self.hass.config_entries.async_reload(entry.entry_id) )