mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +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]
|
gateway_id = hostname[8:22]
|
||||||
|
|
||||||
LOGGER.debug("DHCP discovery detected gateway %s", obfuscate_id(gateway_id))
|
LOGGER.debug("DHCP discovery detected gateway %s", obfuscate_id(gateway_id))
|
||||||
|
return await self._process_discovery(gateway_id)
|
||||||
await self.async_set_unique_id(gateway_id)
|
|
||||||
self._abort_if_unique_id_configured()
|
|
||||||
|
|
||||||
return await self.async_step_user()
|
|
||||||
|
|
||||||
async def async_step_zeroconf(
|
async def async_step_zeroconf(
|
||||||
self, discovery_info: zeroconf.ZeroconfServiceInfo
|
self, discovery_info: zeroconf.ZeroconfServiceInfo
|
||||||
@ -144,9 +140,13 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
gateway_id = properties["gateway_pin"]
|
gateway_id = properties["gateway_pin"]
|
||||||
|
|
||||||
LOGGER.debug("ZeroConf discovery detected gateway %s", obfuscate_id(gateway_id))
|
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)
|
await self.async_set_unique_id(gateway_id)
|
||||||
self._abort_if_unique_id_configured()
|
self._abort_if_unique_id_configured()
|
||||||
|
self.context["title_placeholders"] = {"gateway_id": gateway_id}
|
||||||
|
|
||||||
return await self.async_step_user()
|
return await self.async_step_user()
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"config": {
|
"config": {
|
||||||
|
"flow_title": "Gateway: {gateway_id}",
|
||||||
"step": {
|
"step": {
|
||||||
"user": {
|
"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.",
|
"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",
|
"too_many_requests": "Too many requests, try again later",
|
||||||
"unknown": "Unexpected error"
|
"unknown": "Unexpected error"
|
||||||
},
|
},
|
||||||
|
"flow_title": "Gateway: {gateway_id}",
|
||||||
"step": {
|
"step": {
|
||||||
"user": {
|
"user": {
|
||||||
"data": {
|
"data": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user