mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
Correct typing of async_track_state_change (#79150)
* Correct typing of async_track_state_change * Update integrations
This commit is contained in:
parent
4fcd0f3e23
commit
7ead77eea6
@ -157,9 +157,12 @@ class Proximity(Entity):
|
|||||||
return {ATTR_DIR_OF_TRAVEL: self.dir_of_travel, ATTR_NEAREST: self.nearest}
|
return {ATTR_DIR_OF_TRAVEL: self.dir_of_travel, ATTR_NEAREST: self.nearest}
|
||||||
|
|
||||||
def check_proximity_state_change(
|
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:
|
) -> None:
|
||||||
"""Perform the proximity checking."""
|
"""Perform the proximity checking."""
|
||||||
|
if new_state is None:
|
||||||
|
return
|
||||||
|
|
||||||
entity_name = new_state.name
|
entity_name = new_state.name
|
||||||
devices_to_calculate = False
|
devices_to_calculate = False
|
||||||
devices_in_zone = ""
|
devices_in_zone = ""
|
||||||
|
@ -141,7 +141,9 @@ def threaded_listener_factory(
|
|||||||
def async_track_state_change(
|
def async_track_state_change(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
entity_ids: str | Iterable[str],
|
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,
|
from_state: None | str | Iterable[str] = None,
|
||||||
to_state: None | str | Iterable[str] = None,
|
to_state: None | str | Iterable[str] = None,
|
||||||
) -> CALLBACK_TYPE:
|
) -> CALLBACK_TYPE:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user