Improve debouncer typing (#75436)

This commit is contained in:
Marc Mueller 2022-07-19 18:35:04 +02:00 committed by GitHub
parent 4b036cbad9
commit 5ae5ae5392
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 33 additions and 20 deletions

View file

@ -2,6 +2,7 @@
from __future__ import annotations
from collections import OrderedDict
from collections.abc import Coroutine
import logging
import time
from typing import TYPE_CHECKING, Any, NamedTuple, cast
@ -832,7 +833,7 @@ def async_setup_cleanup(hass: HomeAssistant, dev_reg: DeviceRegistry) -> None:
ent_reg = entity_registry.async_get(hass)
async_cleanup(hass, dev_reg, ent_reg)
debounced_cleanup = Debouncer(
debounced_cleanup: Debouncer[Coroutine[Any, Any, None]] = Debouncer(
hass, _LOGGER, cooldown=CLEANUP_DELAY, immediate=False, function=cleanup
)