From 9691128e968105f82b6a14e6dbf8aea40768e954 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 14 Feb 2022 10:12:24 -0600 Subject: [PATCH] Fix ImportError when discovery deps change (#66518) --- homeassistant/bootstrap.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/homeassistant/bootstrap.py b/homeassistant/bootstrap.py index a58280158d8..fbe7a6b005f 100644 --- a/homeassistant/bootstrap.py +++ b/homeassistant/bootstrap.py @@ -59,7 +59,7 @@ COOLDOWN_TIME = 60 MAX_LOAD_CONCURRENTLY = 6 DEBUGGER_INTEGRATIONS = {"debugpy"} -CORE_INTEGRATIONS = ("homeassistant", "persistent_notification") +CORE_INTEGRATIONS = {"homeassistant", "persistent_notification"} LOGGING_INTEGRATIONS = { # Set log levels "logger", @@ -69,7 +69,14 @@ LOGGING_INTEGRATIONS = { # To record data "recorder", } +DISCOVERY_INTEGRATIONS = ("dhcp", "ssdp", "usb", "zeroconf") STAGE_1_INTEGRATIONS = { + # We need to make sure discovery integrations + # update their deps before stage 2 integrations + # load them inadvertently before their deps have + # been updated which leads to using an old version + # of the dep, or worse (import errors). + *DISCOVERY_INTEGRATIONS, # To make sure we forward data to other instances "mqtt_eventstream", # To provide account link implementations