mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 18:28:14 +02:00
Improve typing [helpers.event] (#70891)
This commit is contained in:
@ -17,6 +17,7 @@ homeassistant.helpers.area_registry
|
|||||||
homeassistant.helpers.condition
|
homeassistant.helpers.condition
|
||||||
homeassistant.helpers.discovery
|
homeassistant.helpers.discovery
|
||||||
homeassistant.helpers.entity_values
|
homeassistant.helpers.entity_values
|
||||||
|
homeassistant.helpers.event
|
||||||
homeassistant.helpers.reload
|
homeassistant.helpers.reload
|
||||||
homeassistant.helpers.script_variables
|
homeassistant.helpers.script_variables
|
||||||
homeassistant.helpers.translation
|
homeassistant.helpers.translation
|
||||||
|
@ -558,7 +558,7 @@ class _TrackStateChangeFiltered:
|
|||||||
self._setup_entities_listener(track_states.domains, track_states.entities)
|
self._setup_entities_listener(track_states.domains, track_states.entities)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def listeners(self) -> dict:
|
def listeners(self) -> dict[str, bool | set[str]]:
|
||||||
"""State changes that will cause a re-render."""
|
"""State changes that will cause a re-render."""
|
||||||
track_states = self._last_track_states
|
track_states = self._last_track_states
|
||||||
return {
|
return {
|
||||||
@ -853,7 +853,7 @@ class _TrackTemplateResultInfo:
|
|||||||
)
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def listeners(self) -> dict:
|
def listeners(self) -> dict[str, bool | set[str]]:
|
||||||
"""State changes that will cause a re-render."""
|
"""State changes that will cause a re-render."""
|
||||||
assert self._track_state_changes
|
assert self._track_state_changes
|
||||||
return {
|
return {
|
||||||
|
3
mypy.ini
3
mypy.ini
@ -62,6 +62,9 @@ disallow_any_generics = true
|
|||||||
[mypy-homeassistant.helpers.entity_values]
|
[mypy-homeassistant.helpers.entity_values]
|
||||||
disallow_any_generics = true
|
disallow_any_generics = true
|
||||||
|
|
||||||
|
[mypy-homeassistant.helpers.event]
|
||||||
|
disallow_any_generics = true
|
||||||
|
|
||||||
[mypy-homeassistant.helpers.reload]
|
[mypy-homeassistant.helpers.reload]
|
||||||
disallow_any_generics = true
|
disallow_any_generics = true
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user