1
mirror of https://github.com/home-assistant/core synced 2024-08-15 18:25:44 +02:00

Correct typing of async_track_state_change (#79150)

* Correct typing of async_track_state_change

* Update integrations
This commit is contained in:
Erik Montnemery 2022-09-27 17:32:54 +02:00 committed by GitHub
parent 4fcd0f3e23
commit 7ead77eea6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -157,9 +157,12 @@ class Proximity(Entity):
return {ATTR_DIR_OF_TRAVEL: self.dir_of_travel, ATTR_NEAREST: self.nearest}
def check_proximity_state_change(
self, entity: str, old_state: State | None, new_state: State
self, entity: str, old_state: State | None, new_state: State | None
) -> None:
"""Perform the proximity checking."""
if new_state is None:
return
entity_name = new_state.name
devices_to_calculate = False
devices_in_zone = ""

View File

@ -141,7 +141,9 @@ def threaded_listener_factory(
def async_track_state_change(
hass: HomeAssistant,
entity_ids: str | Iterable[str],
action: Callable[[str, State | None, State], Coroutine[Any, Any, None] | None],
action: Callable[
[str, State | None, State | None], Coroutine[Any, Any, None] | None
],
from_state: None | str | Iterable[str] = None,
to_state: None | str | Iterable[str] = None,
) -> CALLBACK_TYPE: