mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 02:49:40 +00:00
Cleanup async handling (#6388)
* Cleanups unneeded blocks * Cleanup bootstrap * dedicated update_ha_state * Fix imap_email_content * fx tests * Fix lint & spell
This commit is contained in:
committed by
Paulus Schoutsen
parent
3044aecbe9
commit
8232f1ef65
@@ -55,6 +55,9 @@ def async_setup_component(hass: core.HomeAssistant, domain: str,
|
||||
|
||||
This method is a coroutine.
|
||||
"""
|
||||
if domain in hass.config.components:
|
||||
return True
|
||||
|
||||
setup_tasks = hass.data.get(DATA_SETUP)
|
||||
|
||||
if setup_tasks is not None and domain in setup_tasks:
|
||||
@@ -211,6 +214,10 @@ def _async_setup_component(hass: core.HomeAssistant,
|
||||
|
||||
hass.config.components.add(component.DOMAIN)
|
||||
|
||||
# cleanup
|
||||
if domain in hass.data[DATA_SETUP]:
|
||||
hass.data[DATA_SETUP].pop(domain)
|
||||
|
||||
hass.bus.async_fire(
|
||||
EVENT_COMPONENT_LOADED, {ATTR_COMPONENT: component.DOMAIN}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user