Fixing config_entries.async_forward_entry_unload calls (step 1) (#27857)

pull/28225/head
Quentame 2019-10-20 12:15:46 +02:00 committed by Pascal Vizeli
parent c42ca94a86
commit 5ce437dc30
5 changed files with 5 additions and 19 deletions

View File

@ -19,7 +19,4 @@ async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry):
async def async_unload_entry(hass, entry):
"""Unload a config entry."""
hass.async_create_task(
hass.config_entries.async_forward_entry_unload(entry, "sensor")
)
return True
return await hass.config_entries.async_forward_entry_unload(entry, "sensor")

View File

@ -55,7 +55,4 @@ async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry):
async def async_unload_entry(hass: HomeAssistantType, entry: ConfigEntry):
"""Unload Linky sensors."""
hass.async_create_task(
hass.config_entries.async_forward_entry_unload(entry, "sensor")
)
return True
return await hass.config_entries.async_forward_entry_unload(entry, "sensor")

View File

@ -127,8 +127,7 @@ async def async_unload_entry(hass, entry):
"""Unload a config entry."""
hass.components.webhook.async_unregister(entry.data[CONF_WEBHOOK_ID])
hass.data[DOMAIN]["unsub_device_tracker"].pop(entry.entry_id)()
await hass.config_entries.async_forward_entry_unload(entry, DEVICE_TRACKER)
return True
return await hass.config_entries.async_forward_entry_unload(entry, DEVICE_TRACKER)
# pylint: disable=invalid-name

View File

@ -172,12 +172,9 @@ async def async_unload_entry(hass, config_entry):
)
remove_listener()
for component in ("sensor",):
await hass.config_entries.async_forward_entry_unload(config_entry, component)
hass.data[DOMAIN][DATA_LUFTDATEN_CLIENT].pop(config_entry.entry_id)
return True
return await hass.config_entries.async_forward_entry_unload(config_entry, "sensor")
class LuftDatenData:

View File

@ -92,8 +92,4 @@ async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry):
async def async_unload_entry(hass: HomeAssistantType, entry: ConfigEntry):
"""Unload Withings config entry."""
await hass.async_create_task(
hass.config_entries.async_forward_entry_unload(entry, "sensor")
)
return True
return await hass.config_entries.async_forward_entry_unload(entry, "sensor")