Add support for an external step in config flow (#23782)

* Add support for an external step in config flow

* Types

* Lint
This commit is contained in:
Paulus Schoutsen 2019-05-10 05:33:50 -07:00 committed by Pascal Vizeli
parent 4214a354a7
commit 5888e32360
4 changed files with 129 additions and 11 deletions

View file

@ -951,3 +951,16 @@ def mock_entity_platform(hass, platform_path, module):
_LOGGER.info("Adding mock integration platform: %s", platform_path)
module_cache["{}.{}".format(platform_name, domain)] = module
def async_capture_events(hass, event_name):
"""Create a helper that captures events."""
events = []
@ha.callback
def capture_events(event):
events.append(event)
hass.bus.async_listen(event_name, capture_events)
return events