From 99c904ea5d121036a3d08c650b27774fd318b02d Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Fri, 17 Feb 2023 14:55:13 -0500 Subject: [PATCH] Fix dangling task for plum_lightpad (#88295) --- homeassistant/components/plum_lightpad/light.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/plum_lightpad/light.py b/homeassistant/components/plum_lightpad/light.py index 770570a3c39..9f26200e9ae 100644 --- a/homeassistant/components/plum_lightpad/light.py +++ b/homeassistant/components/plum_lightpad/light.py @@ -1,7 +1,6 @@ """Support for Plum Lightpad lights.""" from __future__ import annotations -import asyncio from typing import Any from plumlightpad import Plum @@ -51,13 +50,15 @@ async def async_setup_entry( setup_entities(device) device_web_session = async_get_clientsession(hass, verify_ssl=False) - asyncio.create_task( + entry.async_create_background_task( + hass, plum.discover( hass.loop, loadListener=new_load, lightpadListener=new_lightpad, websession=device_web_session, - ) + ), + "plum.light-discover", )