1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Refactor data entry flow (#15883)

* Refactoring data_entry_flow and config_entry_flow

Move SOURCE_* to config_entries
Change data_entry_flow.FlowManager.async_init() source param default
 to None
Change this first step_id as source or init if source is None
_BaseFlowManagerView pass in SOURCE_USER as default source

* First step of data entry flow decided by _async_create_flow() now

* Lint

* Change helpers.config_entry_flow.DiscoveryFlowHandler default step

* Change FlowManager.async_init source param to context dict param
This commit is contained in:
Jason Hu
2018-08-09 04:24:14 -07:00
committed by Paulus Schoutsen
parent 39d19f2183
commit f58425dd3c
25 changed files with 128 additions and 79 deletions

View File

@@ -58,6 +58,10 @@ class NestFlowHandler(data_entry_flow.FlowHandler):
"""Initialize the Nest config flow."""
self.flow_impl = None
async def async_step_user(self, user_input=None):
"""Handle a flow initialized by the user."""
return await self.async_step_init(user_input)
async def async_step_init(self, user_input=None):
"""Handle a flow start."""
flows = self.hass.data.get(DATA_FLOW_IMPL, {})