Reduce config entry setup/unload boilerplate G-J (#49737)

This commit is contained in:
J. Nick Koston 2021-04-27 04:09:59 -10:00 committed by GitHub
parent 157dd273da
commit a1fdf84dba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
43 changed files with 172 additions and 493 deletions

View file

@ -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