Skip to content

Commit

Permalink
Merge d776bb1 into 9011467
Browse files Browse the repository at this point in the history
  • Loading branch information
bramstroker committed Oct 31, 2022
2 parents 9011467 + d776bb1 commit 01a5dc3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion custom_components/powercalc/__init__.py
Expand Up @@ -18,6 +18,7 @@
SOURCE_INTEGRATION_DISCOVERY,
SOURCE_USER,
ConfigEntry,
ConfigEntryState,
)
from homeassistant.const import (
CONF_DOMAIN,
Expand Down Expand Up @@ -243,7 +244,7 @@ async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) ->
updated_group_entry = await update_associated_group_entry(
hass, config_entry, remove=True
)
if updated_group_entry:
if updated_group_entry and updated_group_entry.state == ConfigEntryState.LOADED:
await hass.config_entries.async_reload(updated_group_entry.entry_id)

used_unique_ids: list[str] = hass.data[DOMAIN][DATA_USED_UNIQUE_IDS]
Expand Down

0 comments on commit 01a5dc3

Please sign in to comment.