Skip to content

Commit

Permalink
update load and unload platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
brg468 committed Jun 20, 2024
1 parent 7219503 commit aa5226c
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions custom_components/wyzeapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
options_dict = {BULB_LOCAL_CONTROL: config_entry.options.get(BULB_LOCAL_CONTROL, DEFAULT_LOCAL_CONTROL)}
hass.config_entries.async_update_entry(config_entry, options=options_dict)

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

mac_addresses = await client.unique_device_ids

Expand Down Expand Up @@ -167,15 +164,4 @@ async def options_update_listener(
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""

unload_ok = all(
await asyncio.gather(
*[
hass.config_entries.async_forward_entry_unload(entry, platform)
for platform in PLATFORMS
]
)
)
if unload_ok:
hass.data[DOMAIN].pop(entry.entry_id)

return unload_ok
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)

0 comments on commit aa5226c

Please sign in to comment.