Add type hints to setup_scanner (#63825)
* Add type hints to setup_scanner * Fix aprs tests * Revert "Add type hints to setup_scanner" This reverts commit3e8b295484
. * Revert "Fix aprs tests" This reverts commit854b37aee8
. * Add type hints to setup_scanner * Fix aprs tests Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
4eae888546
commit
c6416955c6
6 changed files with 58 additions and 14 deletions
|
@ -1,4 +1,7 @@
|
|||
"""Support for FleetGO Platform."""
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Callable
|
||||
import logging
|
||||
|
||||
import requests
|
||||
|
@ -15,8 +18,10 @@ from homeassistant.const import (
|
|||
CONF_PASSWORD,
|
||||
CONF_USERNAME,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.event import track_utc_time_change
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -31,7 +36,12 @@ PLATFORM_SCHEMA = PARENT_PLATFORM_SCHEMA.extend(
|
|||
)
|
||||
|
||||
|
||||
def setup_scanner(hass, config: dict, see, discovery_info=None):
|
||||
def setup_scanner(
|
||||
hass: HomeAssistant,
|
||||
config: ConfigType,
|
||||
see: Callable[..., None],
|
||||
discovery_info: DiscoveryInfoType | None = None,
|
||||
) -> bool:
|
||||
"""Set up the DeviceScanner and check if login is valid."""
|
||||
scanner = FleetGoDeviceScanner(config, see)
|
||||
if not scanner.login(hass):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue