diff --git a/homeassistant/components/overkiz/config_flow.py b/homeassistant/components/overkiz/config_flow.py index 1a0a94198cc..2f8dcc18921 100644 --- a/homeassistant/components/overkiz/config_flow.py +++ b/homeassistant/components/overkiz/config_flow.py @@ -128,11 +128,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): gateway_id = hostname[8:22] LOGGER.debug("DHCP discovery detected gateway %s", obfuscate_id(gateway_id)) - - await self.async_set_unique_id(gateway_id) - self._abort_if_unique_id_configured() - - return await self.async_step_user() + return await self._process_discovery(gateway_id) async def async_step_zeroconf( self, discovery_info: zeroconf.ZeroconfServiceInfo @@ -144,9 +140,13 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): gateway_id = properties["gateway_pin"] LOGGER.debug("ZeroConf discovery detected gateway %s", obfuscate_id(gateway_id)) + return await self._process_discovery(gateway_id) + async def _process_discovery(self, gateway_id: str) -> FlowResult: + """Handle discovery of a gateway.""" await self.async_set_unique_id(gateway_id) self._abort_if_unique_id_configured() + self.context["title_placeholders"] = {"gateway_id": gateway_id} return await self.async_step_user() diff --git a/homeassistant/components/overkiz/strings.json b/homeassistant/components/overkiz/strings.json index 2bef16ec2dd..87487d53c66 100644 --- a/homeassistant/components/overkiz/strings.json +++ b/homeassistant/components/overkiz/strings.json @@ -1,5 +1,6 @@ { "config": { + "flow_title": "Gateway: {gateway_id}", "step": { "user": { "description": "The Overkiz platform is used by various vendors like Somfy (Connexoon / TaHoma), Hitachi (Hi Kumo), Rexel (Energeasy Connect) and Atlantic (Cozytouch). Enter your application credentials and select your hub.", diff --git a/homeassistant/components/overkiz/translations/en.json b/homeassistant/components/overkiz/translations/en.json index 42380904583..c9551aa555c 100644 --- a/homeassistant/components/overkiz/translations/en.json +++ b/homeassistant/components/overkiz/translations/en.json @@ -12,6 +12,7 @@ "too_many_requests": "Too many requests, try again later", "unknown": "Unexpected error" }, + "flow_title": "Gateway: {gateway_id}", "step": { "user": { "data": {