mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 14:27:07 +00:00
Fix MQTT Config Entry Discovery (#16919)
This commit is contained in:
parent
81e21b90c9
commit
2d104f95d7
@ -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
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user