Remove deprecated async_get_scanner from netgear (#63862)
This commit is contained in:
parent
6d162929a6
commit
f24b3509a7
2 changed files with 4 additions and 36 deletions
|
@ -1,15 +1,16 @@
|
|||
"""Support for Netgear routers."""
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.device_tracker import (
|
||||
DOMAIN as DEVICE_TRACKER_DOMAIN,
|
||||
PLATFORM_SCHEMA as PARENT_PLATFORM_SCHEMA,
|
||||
SOURCE_TYPE_ROUTER,
|
||||
)
|
||||
from homeassistant.components.device_tracker.config_entry import ScannerEntity
|
||||
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import (
|
||||
CONF_DEVICES,
|
||||
CONF_EXCLUDE,
|
||||
|
@ -23,7 +24,7 @@ from homeassistant.core import HomeAssistant, callback
|
|||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from .const import DEVICE_ICONS, DOMAIN
|
||||
from .const import DEVICE_ICONS
|
||||
from .router import NetgearDeviceEntity, NetgearRouter, async_setup_netgear_entry
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
@ -44,25 +45,6 @@ PLATFORM_SCHEMA = PARENT_PLATFORM_SCHEMA.extend(
|
|||
)
|
||||
|
||||
|
||||
async def async_get_scanner(hass, config):
|
||||
"""Import Netgear configuration from YAML."""
|
||||
hass.async_create_task(
|
||||
hass.config_entries.flow.async_init(
|
||||
DOMAIN,
|
||||
context={"source": SOURCE_IMPORT},
|
||||
data=config[DEVICE_TRACKER_DOMAIN],
|
||||
)
|
||||
)
|
||||
|
||||
_LOGGER.warning(
|
||||
"Your Netgear configuration has been imported into the UI, "
|
||||
"please remove it from configuration.yaml. "
|
||||
"Loading Netgear via platform setup is now deprecated"
|
||||
)
|
||||
|
||||
return None
|
||||
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
|
||||
) -> None:
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
"""Configure Netgear tests."""
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture(name="bypass_setup", autouse=True)
|
||||
def bypass_setup_fixture():
|
||||
"""Mock component setup."""
|
||||
with patch(
|
||||
"homeassistant.components.netgear.device_tracker.async_get_scanner",
|
||||
return_value=None,
|
||||
):
|
||||
yield
|
Loading…
Add table
Reference in a new issue