Add missing hass type hint in component tests (t) (#124274)

This commit is contained in:
epenet 2024-08-20 12:55:39 +02:00 committed by GitHub
parent 14775c822f
commit 3dc83ef19d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 186 additions and 126 deletions

View file

@ -39,8 +39,12 @@ def _find_traces(traces, trace_type, item_id):
async def _setup_automation_or_script(
hass, domain, configs, script_config=None, stored_traces=None
):
hass: HomeAssistant,
domain: str,
configs: list[dict[str, Any]],
script_config: dict[str, Any] | None = None,
stored_traces: int | None = None,
) -> None:
"""Set up automations or scripts from automation config."""
if domain == "script":
configs = {config["id"]: {"sequence": config["action"]} for config in configs}
@ -66,7 +70,13 @@ async def _setup_automation_or_script(
assert await async_setup_component(hass, domain, {domain: configs})
async def _run_automation_or_script(hass, domain, config, event, context=None):
async def _run_automation_or_script(
hass: HomeAssistant,
domain: str,
config: dict[str, Any],
event: str,
context: dict[str, Any] | None = None,
) -> None:
if domain == "automation":
hass.bus.async_fire(event, context=context)
else: