mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 02:07:09 +00:00
Revert wiz reload on setup_retry discovery (#72743)
This commit is contained in:
parent
b3682a5c81
commit
4ae3929a00
@ -10,7 +10,7 @@ from pywizlight.exceptions import WizLightConnectionError, WizLightTimeOutError
|
|||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components import dhcp
|
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.const import CONF_HOST
|
||||||
from homeassistant.data_entry_flow import AbortFlow, FlowResult
|
from homeassistant.data_entry_flow import AbortFlow, FlowResult
|
||||||
from homeassistant.util.network import is_ip_address
|
from homeassistant.util.network import is_ip_address
|
||||||
@ -58,15 +58,7 @@ class WizConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
_LOGGER.debug("Discovered device: %s", device)
|
_LOGGER.debug("Discovered device: %s", device)
|
||||||
ip_address = device.ip_address
|
ip_address = device.ip_address
|
||||||
mac = device.mac_address
|
mac = device.mac_address
|
||||||
if current_entry := await self.async_set_unique_id(mac):
|
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")
|
|
||||||
self._abort_if_unique_id_configured(updates={CONF_HOST: ip_address})
|
self._abort_if_unique_id_configured(updates={CONF_HOST: ip_address})
|
||||||
await self._async_connect_discovered_or_abort()
|
await self._async_connect_discovered_or_abort()
|
||||||
return await self.async_step_discovery_confirm()
|
return await self.async_step_discovery_confirm()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user