mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Fix asyncio.wait typing (#99726)
This commit is contained in:
parent
0b95e4ac17
commit
5d54660802
@ -2,7 +2,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
from collections.abc import Awaitable
|
||||
from datetime import datetime, timedelta
|
||||
import logging
|
||||
from typing import Final
|
||||
@ -152,7 +151,7 @@ async def async_setup_scanner(
|
||||
async def perform_bluetooth_update() -> None:
|
||||
"""Discover Bluetooth devices and update status."""
|
||||
_LOGGER.debug("Performing Bluetooth devices discovery and update")
|
||||
tasks: list[Awaitable[None]] = []
|
||||
tasks: list[asyncio.Task[None]] = []
|
||||
|
||||
try:
|
||||
if track_new:
|
||||
|
@ -6,14 +6,7 @@ of entities and react to changes.
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
from collections.abc import (
|
||||
Awaitable,
|
||||
Callable,
|
||||
Collection,
|
||||
Coroutine,
|
||||
Iterable,
|
||||
Mapping,
|
||||
)
|
||||
from collections.abc import Callable, Collection, Coroutine, Iterable, Mapping
|
||||
import concurrent.futures
|
||||
from contextlib import suppress
|
||||
import datetime
|
||||
@ -714,7 +707,9 @@ class HomeAssistant:
|
||||
for task in tasks:
|
||||
_LOGGER.debug("Waiting for task: %s", task)
|
||||
|
||||
async def _await_and_log_pending(self, pending: Collection[Awaitable[Any]]) -> None:
|
||||
async def _await_and_log_pending(
|
||||
self, pending: Collection[asyncio.Future[Any]]
|
||||
) -> None:
|
||||
"""Await and log tasks that take a long time."""
|
||||
wait_time = 0
|
||||
while pending:
|
||||
|
Loading…
x
Reference in New Issue
Block a user