Skip to content

Commit d47bf90

Browse files
author
marq24
committed
use 'async_forward_entry_setups' & 'async_unload_platforms'
1 parent 365fc5a commit d47bf90

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

custom_components/tibber_local/__init__.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry):
7676

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

79-
for platform in PLATFORMS:
80-
hass.async_create_task(hass.config_entries.async_forward_entry_setup(config_entry, platform))
79+
await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)
8180

8281
if config_entry.state != ConfigEntryState.LOADED:
8382
config_entry.add_update_listener(async_reload_entry)
@@ -135,10 +134,7 @@ async def _async_update_data(self):
135134

136135

137136
async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry):
138-
unload_ok = all(await asyncio.gather(*[
139-
hass.config_entries.async_forward_entry_unload(config_entry, component)
140-
for component in PLATFORMS
141-
]))
137+
unload_ok = await hass.config_entries.async_unload_platforms(config_entry, PLATFORMS)
142138
if unload_ok:
143139
if DOMAIN in hass.data and config_entry.entry_id in hass.data[DOMAIN]:
144140
hass.data[DOMAIN].pop(config_entry.entry_id)

custom_components/tibber_local/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
"iot_class": "local_polling",
1111
"issue_tracker": "https://github.com/marq24/ha-tibber-pulse-local/issues",
1212
"requirements": ["smllib==1.4"],
13-
"version": "2024.6.3"
13+
"version": "2024.7.0"
1414
}

0 commit comments

Comments
 (0)