mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Fix invalid get_scanner return value in unify_direct (#63855)
This commit is contained in:
parent
f24b3509a7
commit
edc4d3bb6e
@ -1,4 +1,6 @@
|
||||
"""Support for Unifi AP direct access."""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import logging
|
||||
|
||||
@ -11,7 +13,9 @@ from homeassistant.components.device_tracker import (
|
||||
DeviceScanner,
|
||||
)
|
||||
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_PORT, CONF_USERNAME
|
||||
from homeassistant.core import HomeAssistant
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.typing import ConfigType
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@ -30,11 +34,11 @@ PLATFORM_SCHEMA = PARENT_PLATFORM_SCHEMA.extend(
|
||||
)
|
||||
|
||||
|
||||
def get_scanner(hass, config):
|
||||
def get_scanner(hass: HomeAssistant, config: ConfigType) -> DeviceScanner | None:
|
||||
"""Validate the configuration and return a Unifi direct scanner."""
|
||||
scanner = UnifiDeviceScanner(config[DOMAIN])
|
||||
if not scanner.connected:
|
||||
return False
|
||||
return None
|
||||
return scanner
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user