mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 10:47:10 +00:00
Fixing config_entries.async_forward_entry_unload calls (step 1) (#27857)
This commit is contained in:
parent
c42ca94a86
commit
5ce437dc30
@ -19,7 +19,4 @@ async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry):
|
|||||||
|
|
||||||
async def async_unload_entry(hass, entry):
|
async def async_unload_entry(hass, entry):
|
||||||
"""Unload a config entry."""
|
"""Unload a config entry."""
|
||||||
hass.async_create_task(
|
return await hass.config_entries.async_forward_entry_unload(entry, "sensor")
|
||||||
hass.config_entries.async_forward_entry_unload(entry, "sensor")
|
|
||||||
)
|
|
||||||
return True
|
|
||||||
|
@ -55,7 +55,4 @@ async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry):
|
|||||||
|
|
||||||
async def async_unload_entry(hass: HomeAssistantType, entry: ConfigEntry):
|
async def async_unload_entry(hass: HomeAssistantType, entry: ConfigEntry):
|
||||||
"""Unload Linky sensors."""
|
"""Unload Linky sensors."""
|
||||||
hass.async_create_task(
|
return await hass.config_entries.async_forward_entry_unload(entry, "sensor")
|
||||||
hass.config_entries.async_forward_entry_unload(entry, "sensor")
|
|
||||||
)
|
|
||||||
return True
|
|
||||||
|
@ -127,8 +127,7 @@ async def async_unload_entry(hass, entry):
|
|||||||
"""Unload a config entry."""
|
"""Unload a config entry."""
|
||||||
hass.components.webhook.async_unregister(entry.data[CONF_WEBHOOK_ID])
|
hass.components.webhook.async_unregister(entry.data[CONF_WEBHOOK_ID])
|
||||||
hass.data[DOMAIN]["unsub_device_tracker"].pop(entry.entry_id)()
|
hass.data[DOMAIN]["unsub_device_tracker"].pop(entry.entry_id)()
|
||||||
await hass.config_entries.async_forward_entry_unload(entry, DEVICE_TRACKER)
|
return await hass.config_entries.async_forward_entry_unload(entry, DEVICE_TRACKER)
|
||||||
return True
|
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=invalid-name
|
# pylint: disable=invalid-name
|
||||||
|
@ -172,12 +172,9 @@ async def async_unload_entry(hass, config_entry):
|
|||||||
)
|
)
|
||||||
remove_listener()
|
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)
|
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:
|
class LuftDatenData:
|
||||||
|
@ -92,8 +92,4 @@ async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry):
|
|||||||
|
|
||||||
async def async_unload_entry(hass: HomeAssistantType, entry: ConfigEntry):
|
async def async_unload_entry(hass: HomeAssistantType, entry: ConfigEntry):
|
||||||
"""Unload Withings config entry."""
|
"""Unload Withings config entry."""
|
||||||
await hass.async_create_task(
|
return await hass.config_entries.async_forward_entry_unload(entry, "sensor")
|
||||||
hass.config_entries.async_forward_entry_unload(entry, "sensor")
|
|
||||||
)
|
|
||||||
|
|
||||||
return True
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user