Revert wiz reload on setup_retry discovery (#72743)
parent
b3682a5c81
commit
4ae3929a00
|
@ -10,7 +10,7 @@ from pywizlight.exceptions import WizLightConnectionError, WizLightTimeOutError
|
|||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components import dhcp
|
||||
from homeassistant.config_entries import ConfigEntryState, ConfigFlow
|
||||
from homeassistant.config_entries import ConfigFlow
|
||||
from homeassistant.const import CONF_HOST
|
||||
from homeassistant.data_entry_flow import AbortFlow, FlowResult
|
||||
from homeassistant.util.network import is_ip_address
|
||||
|
@ -58,15 +58,7 @@ class WizConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
_LOGGER.debug("Discovered device: %s", device)
|
||||
ip_address = device.ip_address
|
||||
mac = device.mac_address
|
||||
if current_entry := await self.async_set_unique_id(mac):
|
||||
if (
|
||||
current_entry.state is ConfigEntryState.SETUP_RETRY
|
||||
and current_entry.data[CONF_HOST] == ip_address
|
||||
):
|
||||
self.hass.async_create_task(
|
||||
self.hass.config_entries.async_reload(current_entry.entry_id)
|
||||
)
|
||||
return self.async_abort(reason="already_configured")
|
||||
await self.async_set_unique_id(mac)
|
||||
self._abort_if_unique_id_configured(updates={CONF_HOST: ip_address})
|
||||
await self._async_connect_discovered_or_abort()
|
||||
return await self.async_step_discovery_confirm()
|
||||
|
|
Loading…
Reference in New Issue