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

Change async_setup_platforms into async_forward_entry_setups #342

Merged
merged 1 commit into from
Feb 4, 2023
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
6 changes: 5 additions & 1 deletion custom_components/plugwise/usb.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Support for Plugwise devices connected to a Plugwise USB-stick."""
import asyncio
import logging

from homeassistant.config_entries import ConfigEntry
Expand Down Expand Up @@ -68,7 +69,10 @@ def discover_finished():
].append(mac)
hass.data[DOMAIN][config_entry.entry_id][Platform.SENSOR].append(mac)

hass.config_entries.async_setup_platforms(config_entry, PLATFORMS_USB)
asyncio.run_coroutine_threadsafe(
hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS_USB),
hass.loop,
)

def add_new_node(mac):
"""Add Listener when a new Plugwise node joined the network."""
Expand Down