From 4ef04840e91330ff932b051ee42ba8634ca0026b Mon Sep 17 00:00:00 2001 From: Jc2k Date: Fri, 20 Dec 2019 20:49:07 +0000 Subject: [PATCH] Don't error on removal of an ignored homekit_controller config entry (#30083) * Don't error on ignored entries * Don't ever call async_remove_entry or async_unload_entry for an unignored ignore config entry --- homeassistant/config_entries.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/homeassistant/config_entries.py b/homeassistant/config_entries.py index 1a010b38e70..8b314547d9c 100644 --- a/homeassistant/config_entries.py +++ b/homeassistant/config_entries.py @@ -246,6 +246,10 @@ class ConfigEntry: Returns if unload is possible and was successful. """ + if self.source == SOURCE_IGNORE: + self.state = ENTRY_STATE_NOT_LOADED + return True + if integration is None: integration = await loader.async_get_integration(hass, self.domain) @@ -292,6 +296,9 @@ class ConfigEntry: async def async_remove(self, hass: HomeAssistant) -> None: """Invoke remove callback on component.""" + if self.source == SOURCE_IGNORE: + return + integration = await loader.async_get_integration(hass, self.domain) component = integration.get_component() if not hasattr(component, "async_remove_entry"):