Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion homeassistant/components/mqtt/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ async def async_step_init(self, user_input=None):
return await self.async_step_broker()

async def async_step_broker(self, user_input=None):
"""Manage the MQTT options."""
"""Manage the MQTT broker configuration."""
errors = {}
current_config = self.config_entry.data
yaml_config = self.hass.data.get(DATA_MQTT_CONFIG, {})
Expand Down Expand Up @@ -201,6 +201,7 @@ async def async_step_broker(self, user_input=None):
step_id="broker",
data_schema=vol.Schema(fields),
errors=errors,
last_step=False,
)

async def async_step_options(self, user_input=None):
Expand Down Expand Up @@ -321,6 +322,7 @@ async def async_step_options(self, user_input=None):
step_id="options",
data_schema=vol.Schema(fields),
errors=errors,
last_step=True,
)


Expand Down
3 changes: 3 additions & 0 deletions homeassistant/data_entry_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class FlowResultDict(TypedDict, total=False):
reason: str
context: dict[str, Any]
result: Any
last_step: bool | None


class FlowManager(abc.ABC):
Expand Down Expand Up @@ -345,6 +346,7 @@ def async_show_form(
data_schema: vol.Schema = None,
errors: dict[str, str] | None = None,
description_placeholders: dict[str, Any] | None = None,
last_step: bool | None = None,
) -> FlowResultDict:
"""Return the definition of a form to gather user input."""
return {
Expand All @@ -355,6 +357,7 @@ def async_show_form(
"data_schema": data_schema,
"errors": errors,
"description_placeholders": description_placeholders,
"last_step": last_step, # Display next or submit button in frontend
Comment thread
emontnemery marked this conversation as resolved.
}

@callback
Expand Down
5 changes: 5 additions & 0 deletions tests/components/config/test_config_entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ async def async_step_user(self, user_input=None):
"show_advanced_options": True,
},
"errors": {"username": "Should be unique."},
"last_step": None,
}


Expand Down Expand Up @@ -370,6 +371,7 @@ async def async_step_account(self, user_input=None):
"data_schema": [{"name": "user_title", "type": "string"}],
"description_placeholders": None,
"errors": None,
"last_step": None,
}

with patch.dict(HANDLERS, {"test": TestFlow}):
Expand Down Expand Up @@ -439,6 +441,7 @@ async def async_step_account(self, user_input=None):
"data_schema": [{"name": "user_title", "type": "string"}],
"description_placeholders": None,
"errors": None,
"last_step": None,
}

hass_admin_user.groups = []
Expand Down Expand Up @@ -606,6 +609,7 @@ async def async_step_init(self, user_input=None):
"data_schema": [{"name": "enabled", "required": True, "type": "boolean"}],
"description_placeholders": {"enabled": "Set to true to be true"},
"errors": None,
"last_step": None,
}


Expand Down Expand Up @@ -654,6 +658,7 @@ async def async_step_finish(self, user_input=None):
"data_schema": [{"name": "enabled", "type": "boolean"}],
"description_placeholders": None,
"errors": None,
"last_step": None,
}

with patch.dict(HANDLERS, {"test": TestFlow}):
Expand Down
1 change: 1 addition & 0 deletions tests/components/subaru/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ async def test_pin_form_init(pin_form):
"handler": DOMAIN,
"step_id": "pin",
"type": "form",
"last_step": None,
}
assert pin_form == expected

Expand Down