Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes warning logged during Home Assistant start #73

Merged
merged 1 commit into from
Jun 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,17 @@ async def async_setup_entry(hass, config_entry) -> bool:
UNDO_UPDATE_LISTENER: undo_listener,
}

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

return True


async def async_unload_entry(hass, config_entry):
"""Unload an FMI config entry."""
for component in PLATFORMS:
await hass.config_entries.async_forward_entry_unload(config_entry, component)
await hass.config_entries.async_unload_platforms(config_entry, PLATFORMS)
Copy link
Contributor Author

@slovdahl slovdahl Jun 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't fix any warning right now, but https://github.com/home-assistant/core/blob/9723b97f4bd42c850f5cb5fbf67ecdfc55769861/homeassistant/config_entries.py#L2175-L2182 says that async_unload_platforms is the preferred method nowadays.

bild


hass.data[DOMAIN][config_entry.entry_id][UNDO_UPDATE_LISTENER]()
hass.data[DOMAIN].pop(config_entry.entry_id)
Expand Down