Skip to content

Commit

Permalink
use 'async_forward_entry_setups' & 'async_unload_platforms'
Browse files Browse the repository at this point in the history
  • Loading branch information
marq24 committed Jul 4, 2024
1 parent 00c62d1 commit 86fef85
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions custom_components/waterkotte_heatpump/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry):

hass.data[DOMAIN][config_entry.entry_id] = coordinator

for platform in PLATFORMS:
hass.async_create_task(hass.config_entries.async_forward_entry_setup(config_entry, platform))
await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)

if config_entry.state != ConfigEntryState.LOADED:
config_entry.add_update_listener(async_reload_entry)
Expand All @@ -101,10 +100,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry):


async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:
unload_ok = all(await asyncio.gather(*[
hass.config_entries.async_forward_entry_unload(config_entry, platform)
for platform in PLATFORMS
]))
unload_ok = await hass.config_entries.async_unload_platforms(config_entry, PLATFORMS)

if unload_ok:
if DOMAIN in hass.data and config_entry.entry_id in hass.data[DOMAIN]:
Expand Down
2 changes: 1 addition & 1 deletion custom_components/waterkotte_heatpump/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
"iot_class": "local_polling",
"issue_tracker": "https://github.com/marq24/ha-waterkotte/issues",
"requirements": [],
"version": "2024.6.2"
"version": "2024.7.0"
}

0 comments on commit 86fef85

Please sign in to comment.