Reduce config entry setup/unload boilerplate G-J (#49737)
This commit is contained in:
parent
157dd273da
commit
a1fdf84dba
43 changed files with 172 additions and 493 deletions
|
@ -157,13 +157,8 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
|
|||
|
||||
async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:
|
||||
"""Unload the Legrand Home+ Control config entry."""
|
||||
unload_ok = all(
|
||||
await asyncio.gather(
|
||||
*[
|
||||
hass.config_entries.async_forward_entry_unload(config_entry, component)
|
||||
for component in PLATFORMS
|
||||
]
|
||||
)
|
||||
unload_ok = await hass.config_entries.async_unload_platforms(
|
||||
config_entry, PLATFORMS
|
||||
)
|
||||
if unload_ok:
|
||||
# Unsubscribe the config_entry signal dispatcher connections
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue