mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Switch mqtt to use async_unload_platforms (#118097)
This commit is contained in:
parent
b58e0331cf
commit
3f76b865fa
@ -522,24 +522,13 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
mqtt_client = mqtt_data.client
|
||||
|
||||
# Unload publish and dump services.
|
||||
hass.services.async_remove(
|
||||
DOMAIN,
|
||||
SERVICE_PUBLISH,
|
||||
)
|
||||
hass.services.async_remove(
|
||||
DOMAIN,
|
||||
SERVICE_DUMP,
|
||||
)
|
||||
hass.services.async_remove(DOMAIN, SERVICE_PUBLISH)
|
||||
hass.services.async_remove(DOMAIN, SERVICE_DUMP)
|
||||
|
||||
# Stop the discovery
|
||||
await discovery.async_stop(hass)
|
||||
# Unload the platforms
|
||||
await asyncio.gather(
|
||||
*(
|
||||
hass.config_entries.async_forward_entry_unload(entry, component)
|
||||
for component in mqtt_data.platforms_loaded
|
||||
)
|
||||
)
|
||||
await hass.config_entries.async_unload_platforms(entry, mqtt_data.platforms_loaded)
|
||||
mqtt_data.platforms_loaded = set()
|
||||
await asyncio.sleep(0)
|
||||
# Unsubscribe reload dispatchers
|
||||
|
Loading…
x
Reference in New Issue
Block a user