deCONZ multiple gateways fixup (#22774)

* Initial PR was merged before a proper review was performed
* These fixes follow Martins review comments after merge
pull/22196/head
Robert Svensson 2019-04-05 22:21:06 +02:00 committed by GitHub
parent 7a33dc5cec
commit d1bf470899
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -4,7 +4,6 @@ import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import (
CONF_API_KEY, CONF_HOST, CONF_PORT, EVENT_HOMEASSISTANT_STOP)
from homeassistant.core import callback
from homeassistant.helpers import config_validation as cv
# Loading the config flow file will register the flow
@ -51,7 +50,7 @@ async def async_setup(hass, config):
"""
if not hass.config_entries.async_entries(DOMAIN) and DOMAIN in config:
deconz_config = config[DOMAIN]
hass.async_add_job(hass.config_entries.flow.async_init(
hass.async_create_task(hass.config_entries.flow.async_init(
DOMAIN, context={'source': config_entries.SOURCE_IMPORT},
data=deconz_config
))
@ -175,7 +174,6 @@ async def async_unload_entry(hass, config_entry):
return await gateway.async_reset()
@callback
async def async_populate_options(hass, config_entry):
"""Populate default options for gateway.

View File

@ -41,7 +41,7 @@ async def test_config_with_host_passed_to_config_entry(hass):
}
}) is True
# Import flow started
assert len(mock_config_flow.mock_calls) == 2
assert len(mock_config_flow.mock_calls) == 1
async def test_config_without_host_not_passed_to_config_entry(hass):