From 46b73f4b970b488eab6c0a0a4791f37d7d07ab97 Mon Sep 17 00:00:00 2001 From: Breugel Date: Thu, 2 Feb 2023 22:23:16 +0100 Subject: [PATCH] Change async_setup_platforms into async_forward_entry_setups As instructed by https://developers.home-assistant.io/blog/2022/07/08/config_entry_forwards/ --- custom_components/plugwise/usb.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/custom_components/plugwise/usb.py b/custom_components/plugwise/usb.py index d50bc8bb1..a59c4e4be 100644 --- a/custom_components/plugwise/usb.py +++ b/custom_components/plugwise/usb.py @@ -1,4 +1,5 @@ """Support for Plugwise devices connected to a Plugwise USB-stick.""" +import asyncio import logging from homeassistant.config_entries import ConfigEntry @@ -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."""