mirror of
https://github.com/home-assistant/core.git
synced 2025-04-28 03:07:50 +00:00
Store arcam_fmj flow data in flow handler attributes (#127166)
This commit is contained in:
parent
0d9f2aee70
commit
73fad671ed
@ -22,6 +22,9 @@ class ArcamFmjFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
|
|
||||||
VERSION = 1
|
VERSION = 1
|
||||||
|
|
||||||
|
host: str
|
||||||
|
port: int
|
||||||
|
|
||||||
async def _async_set_unique_id_and_update(
|
async def _async_set_unique_id_and_update(
|
||||||
self, host: str, port: int, uuid: str
|
self, host: str, port: int, uuid: str
|
||||||
) -> None:
|
) -> None:
|
||||||
@ -74,16 +77,11 @@ class ArcamFmjFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Handle user-confirmation of discovered node."""
|
"""Handle user-confirmation of discovered node."""
|
||||||
context = self.context
|
placeholders = {"host": self.host}
|
||||||
placeholders = {
|
self.context["title_placeholders"] = placeholders
|
||||||
"host": context[CONF_HOST],
|
|
||||||
}
|
|
||||||
context["title_placeholders"] = placeholders
|
|
||||||
|
|
||||||
if user_input is not None:
|
if user_input is not None:
|
||||||
return await self._async_check_and_create(
|
return await self._async_check_and_create(self.host, self.port)
|
||||||
context[CONF_HOST], context[CONF_PORT]
|
|
||||||
)
|
|
||||||
|
|
||||||
return self.async_show_form(
|
return self.async_show_form(
|
||||||
step_id="confirm", description_placeholders=placeholders
|
step_id="confirm", description_placeholders=placeholders
|
||||||
@ -101,7 +99,6 @@ class ArcamFmjFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
|
|
||||||
await self._async_set_unique_id_and_update(host, port, uuid)
|
await self._async_set_unique_id_and_update(host, port, uuid)
|
||||||
|
|
||||||
context = self.context
|
self.host = host
|
||||||
context[CONF_HOST] = host
|
self.port = DEFAULT_PORT
|
||||||
context[CONF_PORT] = DEFAULT_PORT
|
|
||||||
return await self.async_step_confirm()
|
return await self.async_step_confirm()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user