mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Ensure a deleted integration can be removed (#36130)
* Ensure a deleted intergration can be removed * Update homeassistant/config_entries.py Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io> Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
@@ -268,7 +268,15 @@ class ConfigEntry:
|
||||
return True
|
||||
|
||||
if integration is None:
|
||||
integration = await loader.async_get_integration(hass, self.domain)
|
||||
try:
|
||||
integration = await loader.async_get_integration(hass, self.domain)
|
||||
except loader.IntegrationNotFound:
|
||||
# The integration was likely a custom_component
|
||||
# that was uninstalled, or an integration
|
||||
# that has been renamed without removing the config
|
||||
# entry.
|
||||
self.state = ENTRY_STATE_NOT_LOADED
|
||||
return True
|
||||
|
||||
component = integration.get_component()
|
||||
|
||||
@@ -316,7 +324,15 @@ class ConfigEntry:
|
||||
if self.source == SOURCE_IGNORE:
|
||||
return
|
||||
|
||||
integration = await loader.async_get_integration(hass, self.domain)
|
||||
try:
|
||||
integration = await loader.async_get_integration(hass, self.domain)
|
||||
except loader.IntegrationNotFound:
|
||||
# The integration was likely a custom_component
|
||||
# that was uninstalled, or an integration
|
||||
# that has been renamed without removing the config
|
||||
# entry.
|
||||
return
|
||||
|
||||
component = integration.get_component()
|
||||
if not hasattr(component, "async_remove_entry"):
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user