Fix title upon discovery for lamarzocco (#131207)

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
Josef Zweck 2024-11-22 08:56:10 +01:00 committed by GitHub
parent e12db0c88e
commit 786b779a68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View File

@ -125,6 +125,12 @@ class LmConfigFlow(ConfigFlow, domain=DOMAIN):
self._config = data self._config = data
return await self.async_step_machine_selection() return await self.async_step_machine_selection()
placeholders: dict[str, str] | None = None
if self._discovered:
self.context["title_placeholders"] = placeholders = {
CONF_NAME: self._discovered[CONF_MACHINE]
}
return self.async_show_form( return self.async_show_form(
step_id="user", step_id="user",
data_schema=vol.Schema( data_schema=vol.Schema(
@ -134,6 +140,7 @@ class LmConfigFlow(ConfigFlow, domain=DOMAIN):
} }
), ),
errors=errors, errors=errors,
description_placeholders=placeholders,
) )
async def async_step_machine_selection( async def async_step_machine_selection(

View File

@ -1,6 +1,5 @@
{ {
"config": { "config": {
"flow_title": "La Marzocco Espresso {host}",
"abort": { "abort": {
"reauth_successful": "[%key:common::config_flow::abort::reauth_successful%]", "reauth_successful": "[%key:common::config_flow::abort::reauth_successful%]",
"reconfigure_successful": "[%key:common::config_flow::abort::reconfigure_successful%]", "reconfigure_successful": "[%key:common::config_flow::abort::reconfigure_successful%]",