Fix dangling task for plum_lightpad (#88295)

This commit is contained in:
Paulus Schoutsen 2023-02-17 14:55:13 -05:00 committed by GitHub
parent 0a363fa004
commit 99c904ea5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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",
)