Skip to content

Commit

Permalink
Merge pull request #342 from plugwise/fix-platform-setup
Browse files Browse the repository at this point in the history
Change async_setup_platforms into async_forward_entry_setups
  • Loading branch information
bouwew authored Feb 4, 2023
2 parents 5d0ae47 + 46b73f4 commit 411a6a6
Showing 1 changed file with 5 additions and 1 deletion.
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

0 comments on commit 411a6a6

Please sign in to comment.