From a356f3563833e0773f58d954fb05a1d1d31e7ef1 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 16 Feb 2023 23:31:06 -0500 Subject: [PATCH] Fix dangling task for google (#88287) --- homeassistant/components/google/calendar.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/homeassistant/components/google/calendar.py b/homeassistant/components/google/calendar.py index 0c5aa389051..26c4a303dae 100644 --- a/homeassistant/components/google/calendar.py +++ b/homeassistant/components/google/calendar.py @@ -2,7 +2,6 @@ from __future__ import annotations -import asyncio from collections.abc import Iterable from datetime import datetime, timedelta import logging @@ -435,7 +434,7 @@ class GoogleCalendarEntity( await self.coordinator.async_request_refresh() self._apply_coordinator_update() - asyncio.create_task(refresh()) + self.hass.async_create_background_task(refresh(), "google.calendar-refresh") async def async_get_events( self, hass: HomeAssistant, start_date: datetime, end_date: datetime