mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 07:07:28 +00:00
Remove custom flow deduplication logic from guardian (#127159)
This commit is contained in:
parent
4a6e3e0f5a
commit
7129868a56
@ -111,7 +111,7 @@ class GuardianConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
await self._async_set_unique_id(
|
await self._async_set_unique_id(
|
||||||
async_get_pin_from_uid(discovery_info.macaddress.replace(":", "").upper())
|
async_get_pin_from_uid(discovery_info.macaddress.replace(":", "").upper())
|
||||||
)
|
)
|
||||||
return await self._async_handle_discovery()
|
return await self.async_step_discovery_confirm()
|
||||||
|
|
||||||
async def async_step_zeroconf(
|
async def async_step_zeroconf(
|
||||||
self, discovery_info: zeroconf.ZeroconfServiceInfo
|
self, discovery_info: zeroconf.ZeroconfServiceInfo
|
||||||
@ -123,17 +123,6 @@ class GuardianConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
}
|
}
|
||||||
pin = async_get_pin_from_discovery_hostname(discovery_info.hostname)
|
pin = async_get_pin_from_discovery_hostname(discovery_info.hostname)
|
||||||
await self._async_set_unique_id(pin)
|
await self._async_set_unique_id(pin)
|
||||||
return await self._async_handle_discovery()
|
|
||||||
|
|
||||||
async def _async_handle_discovery(self) -> ConfigFlowResult:
|
|
||||||
"""Handle any discovery."""
|
|
||||||
self.context[CONF_IP_ADDRESS] = self.discovery_info[CONF_IP_ADDRESS]
|
|
||||||
if any(
|
|
||||||
self.context[CONF_IP_ADDRESS] == flow["context"][CONF_IP_ADDRESS]
|
|
||||||
for flow in self._async_in_progress()
|
|
||||||
):
|
|
||||||
return self.async_abort(reason="already_in_progress")
|
|
||||||
|
|
||||||
return await self.async_step_discovery_confirm()
|
return await self.async_step_discovery_confirm()
|
||||||
|
|
||||||
async def async_step_discovery_confirm(
|
async def async_step_discovery_confirm(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user