mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 11:47:06 +00:00
Store fully_kiosk flow data in flow handler attributes (#127172)
This commit is contained in:
parent
36df9e0464
commit
825bce32b5
@ -32,6 +32,8 @@ class FullyKioskConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
|
|
||||||
VERSION = 1
|
VERSION = 1
|
||||||
|
|
||||||
|
host: str
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
"""Initialize the config flow."""
|
"""Initialize the config flow."""
|
||||||
self._discovered_device_info: dict[str, Any] = {}
|
self._discovered_device_info: dict[str, Any] = {}
|
||||||
@ -135,15 +137,13 @@ class FullyKioskConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
"""Confirm discovery."""
|
"""Confirm discovery."""
|
||||||
errors: dict[str, str] = {}
|
errors: dict[str, str] = {}
|
||||||
if user_input is not None:
|
if user_input is not None:
|
||||||
result = await self._create_entry(
|
result = await self._create_entry(self.host, user_input, errors)
|
||||||
self.context[CONF_HOST], user_input, errors
|
|
||||||
)
|
|
||||||
if result:
|
if result:
|
||||||
return result
|
return result
|
||||||
|
|
||||||
placeholders = {
|
placeholders = {
|
||||||
"name": self._discovered_device_info["deviceName"],
|
"name": self._discovered_device_info["deviceName"],
|
||||||
CONF_HOST: self.context[CONF_HOST],
|
CONF_HOST: self.host,
|
||||||
}
|
}
|
||||||
self.context["title_placeholders"] = placeholders
|
self.context["title_placeholders"] = placeholders
|
||||||
return self.async_show_form(
|
return self.async_show_form(
|
||||||
@ -168,6 +168,6 @@ class FullyKioskConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
await self.async_set_unique_id(device_id)
|
await self.async_set_unique_id(device_id)
|
||||||
self._abort_if_unique_id_configured()
|
self._abort_if_unique_id_configured()
|
||||||
|
|
||||||
self.context[CONF_HOST] = device_info["hostname4"]
|
self.host = device_info["hostname4"]
|
||||||
self._discovered_device_info = device_info
|
self._discovered_device_info = device_info
|
||||||
return await self.async_step_discovery_confirm()
|
return await self.async_step_discovery_confirm()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user