Fix MQTT Config Entry Discovery (#16919)

This commit is contained in:
Otto Winter 2018-09-27 22:56:04 +02:00 committed by Paulus Schoutsen
parent 81e21b90c9
commit 2d104f95d7

View File

@ -321,7 +321,8 @@ async def _async_setup_server(hass: HomeAssistantType, config: ConfigType):
async def _async_setup_discovery(hass: HomeAssistantType, conf: ConfigType, async def _async_setup_discovery(hass: HomeAssistantType, conf: ConfigType,
hass_config: ConfigType) -> bool: hass_config: ConfigType,
config_entry) -> bool:
"""Try to start the discovery of MQTT devices. """Try to start the discovery of MQTT devices.
This method is a coroutine. This method is a coroutine.
@ -334,7 +335,8 @@ async def _async_setup_discovery(hass: HomeAssistantType, conf: ConfigType,
return False return False
success = await discovery.async_start( success = await discovery.async_start(
hass, conf[CONF_DISCOVERY_PREFIX], hass_config) # type: bool hass, conf[CONF_DISCOVERY_PREFIX], hass_config,
config_entry) # type: bool
return success return success
@ -525,7 +527,7 @@ async def async_setup_entry(hass, entry):
if conf.get(CONF_DISCOVERY): if conf.get(CONF_DISCOVERY):
await _async_setup_discovery( await _async_setup_discovery(
hass, conf, hass.data[DATA_MQTT_HASS_CONFIG]) hass, conf, hass.data[DATA_MQTT_HASS_CONFIG], entry)
return True return True