Add type hints to async_setup_scanner (#63826)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
896885a2c3
commit
c6aaa24027
6 changed files with 63 additions and 14 deletions
|
@ -1,5 +1,8 @@
|
|||
"""Tracks devices by sending a ICMP echo request (ping)."""
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
from collections.abc import Awaitable, Callable
|
||||
from datetime import timedelta
|
||||
import logging
|
||||
import subprocess
|
||||
|
@ -15,8 +18,10 @@ from homeassistant.components.device_tracker.const import (
|
|||
SCAN_INTERVAL,
|
||||
SOURCE_TYPE_ROUTER,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.event import async_track_point_in_utc_time
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
from homeassistant.util.async_ import gather_with_concurrency
|
||||
from homeassistant.util.process import kill_subprocess
|
||||
|
||||
|
@ -77,7 +82,12 @@ class HostSubProcess:
|
|||
return False
|
||||
|
||||
|
||||
async def async_setup_scanner(hass, config, async_see, discovery_info=None):
|
||||
async def async_setup_scanner(
|
||||
hass: HomeAssistant,
|
||||
config: ConfigType,
|
||||
async_see: Callable[..., Awaitable[None]],
|
||||
discovery_info: DiscoveryInfoType | None = None,
|
||||
) -> None:
|
||||
"""Set up the Host objects and return the update function."""
|
||||
|
||||
privileged = hass.data[DOMAIN][PING_PRIVS]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue