mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Add WLED unload entry result correctly (#45783)
This commit is contained in:
parent
2d10c83150
commit
f1d3af1a13
@ -72,19 +72,22 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
"""Unload WLED config entry."""
|
"""Unload WLED config entry."""
|
||||||
|
|
||||||
# Unload entities for this entry/device.
|
# Unload entities for this entry/device.
|
||||||
await asyncio.gather(
|
unload_ok = all(
|
||||||
*(
|
await asyncio.gather(
|
||||||
hass.config_entries.async_forward_entry_unload(entry, component)
|
*(
|
||||||
for component in WLED_COMPONENTS
|
hass.config_entries.async_forward_entry_unload(entry, component)
|
||||||
|
for component in WLED_COMPONENTS
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
# Cleanup
|
if unload_ok:
|
||||||
del hass.data[DOMAIN][entry.entry_id]
|
del hass.data[DOMAIN][entry.entry_id]
|
||||||
|
|
||||||
if not hass.data[DOMAIN]:
|
if not hass.data[DOMAIN]:
|
||||||
del hass.data[DOMAIN]
|
del hass.data[DOMAIN]
|
||||||
|
|
||||||
return True
|
return unload_ok
|
||||||
|
|
||||||
|
|
||||||
def wled_exception_handler(func):
|
def wled_exception_handler(func):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user