Skip to content

Commit

Permalink
Don't error on removal of an ignored homekit_controller config entry (h…
Browse files Browse the repository at this point in the history
…ome-assistant#30083)

* Don't error on ignored entries

* Don't ever call async_remove_entry or async_unload_entry for an unignored ignore config entry
  • Loading branch information
Jc2k authored and balloob committed Dec 20, 2019
1 parent b3098c9 commit 4ef0484
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions homeassistant/config_entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@ async def async_unload(
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)

Expand Down Expand Up @@ -292,6 +296,9 @@ async def async_unload(

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"):
Expand Down

0 comments on commit 4ef0484

Please sign in to comment.