On removal, only unload config entry if loaded (#16844)
* On removal, only unload config entry if loaded * Fix test
This commit is contained in:
1 parent
093285f92f
commit
a1c914dfeb
3 files changed
+42
-4
No files matched your search
@@ -340,7 +340,10 @@ class ConfigEntries:
|
||||
entry = self._entries.pop(found)
|
||||
self._async_schedule_save()
|
||||
|
||||
unloaded = await entry.async_unload(self.hass)
|
||||
if entry.state == ENTRY_STATE_LOADED:
|
||||
unloaded = await entry.async_unload(self.hass)
|
||||
else:
|
||||
unloaded = True
|
||||
|
||||
device_registry = await \
|
||||
self.hass.helpers.device_registry.async_get_registry()
|
||||
|
||||
Reference in new issue
Block a user