mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 18:28:14 +02:00
Protect hass data keys in setup.py (#142589)
This commit is contained in:
@ -72,12 +72,12 @@ from .helpers.json import json_bytes, json_bytes_sorted, json_fragment
|
||||
from .helpers.typing import UNDEFINED, ConfigType, DiscoveryInfoType, UndefinedType
|
||||
from .loader import async_suggest_report_issue
|
||||
from .setup import (
|
||||
DATA_SETUP_DONE,
|
||||
SetupPhases,
|
||||
async_pause_setup,
|
||||
async_process_deps_reqs,
|
||||
async_setup_component,
|
||||
async_start_setup,
|
||||
async_wait_component,
|
||||
)
|
||||
from .util import ulid as ulid_util
|
||||
from .util.async_ import create_eager_task
|
||||
@ -2701,11 +2701,7 @@ class ConfigEntries:
|
||||
Config entries which are created after Home Assistant is started can't be waited
|
||||
for, the function will just return if the config entry is loaded or not.
|
||||
"""
|
||||
setup_done = self.hass.data.get(DATA_SETUP_DONE, {})
|
||||
if setup_future := setup_done.get(entry.domain):
|
||||
await setup_future
|
||||
# The component was not loaded.
|
||||
if entry.domain not in self.hass.config.components:
|
||||
if not await async_wait_component(self.hass, entry.domain):
|
||||
return False
|
||||
return entry.state is ConfigEntryState.LOADED
|
||||
|
||||
|
Reference in New Issue
Block a user