Add protocol types for device_tracker async_see and see (#75891)

This commit is contained in:
Marc Mueller 2022-07-29 00:27:47 +02:00 committed by GitHub
parent 702cef3fc7
commit 003fe9220e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 101 additions and 49 deletions

View file

@ -1,7 +1,6 @@
"""Support for Google Maps location sharing."""
from __future__ import annotations
from collections.abc import Callable
from datetime import timedelta
import logging
@ -12,6 +11,7 @@ import voluptuous as vol
from homeassistant.components.device_tracker import (
PLATFORM_SCHEMA as PLATFORM_SCHEMA_BASE,
SOURCE_TYPE_GPS,
SeeCallback,
)
from homeassistant.const import (
ATTR_BATTERY_CHARGING,
@ -50,7 +50,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA_BASE.extend(
def setup_scanner(
hass: HomeAssistant,
config: ConfigType,
see: Callable[..., None],
see: SeeCallback,
discovery_info: DiscoveryInfoType | None = None,
) -> bool:
"""Set up the Google Maps Location sharing scanner."""
@ -61,7 +61,7 @@ def setup_scanner(
class GoogleMapsScanner:
"""Representation of an Google Maps location sharing account."""
def __init__(self, hass, config: ConfigType, see) -> None:
def __init__(self, hass, config: ConfigType, see: SeeCallback) -> None:
"""Initialize the scanner."""
self.see = see
self.username = config[CONF_USERNAME]