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

@ -50,6 +50,10 @@ class HueFlowHandler(data_entry_flow.FlowHandler):
"""Initialize the Hue flow."""
self.host = 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."""
from aiohue.discovery import discover_nupnp