Fix dangling task for google (#88287)

This commit is contained in:
Paulus Schoutsen 2023-02-16 23:31:06 -05:00 committed by GitHub
parent 0904848579
commit a356f35638
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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