mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Add title placeholders to overkiz discovery (#65506)
* add gateway_id to the config flow context name. * obfuscate gateway_id. * replace const with homeassistant.const. * Remove obfuscation of gateway_id. * fix style. * Add translatable title according to comments * Update homeassistant/components/overkiz/strings.json Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
parent
ebbe1ff1a2
commit
d82899ed2f
@ -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()
|
||||
|
||||
|
@ -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.",
|
||||
|
@ -12,6 +12,7 @@
|
||||
"too_many_requests": "Too many requests, try again later",
|
||||
"unknown": "Unexpected error"
|
||||
},
|
||||
"flow_title": "Gateway: {gateway_id}",
|
||||
"step": {
|
||||
"user": {
|
||||
"data": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user